Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. fin = open('input.txt', 'r', encoding='utf-8')
  2. fout = open('output.txt', 'w', encoding='utf-8')
  3.  
  4. n = fin.read().rstrip()
  5. n = "0" * (4 - len(n)) + n
  6.  
  7. if n == n[::-1]:
  8. print(1, file=fout)
  9. else:
  10. print(2, file=fout)
  11.  
  12. fin.close()
  13. fout.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement