Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 5 Coins
- change = float(input())
- coins_counter = 0
- while change > 0:
- if change >= 2:
- change -= 2
- elif change >= 1:
- change -= 1
- elif change >= 0.50:
- change -= 0.50
- elif change >= 0.20:
- change -= 0.20
- elif change >= 0.10:
- change -= 0.10
- elif change >= 0.05:
- change -= 0.05
- elif change >= 0.02:
- change -= 0.02
- elif change >= 0.01:
- change -= 0.01
- change = round(change, 2)
- coins_counter += 1
- print(coins_counter)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement