Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global _input
- while (True):
- try:
- _input = input('Введите число')
- int(_input)
- assert len(_input) == 4
- except ValueError:
- print('Введи число!!!')
- except AssertionError:
- print('Число должно быть четырехзначным')
- else:
- break
- a = _input [0:2]
- b = _input [3] + _input [2]
- if a == b:
- print ('1')
- else:
- print ('0')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement