Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Is there any interactive programming language where 1.0 is an integer?
- def five():
- a = 0
- b = 0
- c = 0
- while a <= 9:
- a = a + 1
- b = a / 5
- if type(b) == int and b is not 0:
- c = c + 1
- else:
- pass
- print c
- if a % 5 == 0:
- c = c + 1
- def five():
- count = 0
- for i in range(1, 10):
- if i%5 == 0:
- count += 1
- print (count, end='')
- count = 0
- for i in range(1,10):
- if i % 5 == 0:
- count += 1
- print count
- >>> (1.0).is_integer()
- True
- >>> (1.1).is_integer()
- False
- sum([0 if x%5 else 1 for x in range(1,10)])
Add Comment
Please, Sign In to add comment