Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fin = open('input.txt', 'r', encoding='utf8')
- handle = open("output.txt", "w")
- data = fin.read()
- my_list = list(data)
- #data='2002'
- if len(my_list) == 4:
- if my_list[0] == my_list[3] and my_list[1] == my_list[2]:
- handle.write(1)
- else:
- handle.write(0)
- else:
- handle.write(0)
- handle.close()
- fin.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement