Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- number = int(input())
- bonus = 0.0
- if number <= 100:
- bonus = 5
- elif number > 1000:
- bonus = number * 0.1
- else:
- bonus = number * 0.2
- if number % 2 == 0:
- bonus += 1
- elif number % 10 == 5:
- bonus += 2
- print(bonus)
- print(number + bonus)
- Тарикатско решение:
- number = int(input())
- bonus = {number <= 100: 5, 100 < number <= 1000: number * 0.2, number > 1000: number * 0.1}[True]
- bonus += 1 if number % 2 == 0 else 0
- bonus += 2 if number % 10 == 5 else 0
- print(f'{bonus}\n{number + bonus}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement