Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- num = float(input())
- if num == 0:
- print('zero')
- elif num > 0:
- if num < 1:
- print('small positive')
- elif num > 1000000:
- print('large positive')
- else:
- print('positive')
- else:
- if abs(num) < 1:
- print('small negative')
- elif abs(num) > 1000000:
- print('large negative')
- else:
- print('negative')
- Решение с колекция:
- n = float(input())
- output = {n == 0: 'zero',
- 0 < n < 1: 'small positive',
- 1 <= n <= 1000000: 'positive',
- n > 1000000: 'large positive',
- 0 > n > -1: 'small negative',
- -1 >= n >= -1000000: 'negative',
- n < -1000000: 'large negative'}
- print(output[True])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement