Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Kontrola vstupu
- def wrong_input(inpt):
- # Pomocna promenna
- result = False
- # Je vstup 4 mistne cele cilo?
- if not inpt.isdecimal() or len(inpt) != 4:
- print('Please enter a whole 4-digit number')
- result = True
- # Ma cislo unikatni cislice?
- if len(set(inpt)) != 4:
- print('Please enter a number not repeating the digits')
- result = True
- # Vraceni testovani
- return result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement