Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- n = str(sys.argv[1]) # n = sys.argv[1] також не працює
- def count_holes(n):
- n = n.lstrip('0')
- if n[0] == '-' or n[0] == '+':
- n = str(n[1:])
- if type(n) == int or n.isdigit():
- new = str(n)
- count = 0
- for x in new:
- if x == '0':
- count += 1
- if x == '4':
- count += 1
- if x == '6':
- count += 1
- if x == '9':
- count += 1
- if x == '8':
- count += 2
- return count
- else:
- print 'ERROR'
- print count_holes(n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement