Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # KOODIPAJA 2
- print("Tervetuloa koodipajaan 24.9.2020!")
- # tämän voisi pyytää käyttäjältä
- coins = 97
- # tapa 1
- cents50 = coins / 50
- cents50 = int(cents50)
- coins = coins - (cents50 * 50)
- print(f"50snt kolikot: {cents50}")
- print(f"Jäljelle jää {coins} snt")
- coins = 97
- # tapa 2
- cents50 = coins / 50
- cents50 = int(cents50)
- coins = coins % 50
- print(f"50snt kolikot: {cents50}")
- print(f"Jäljelle jää {coins} snt")
- # tapa 3
- coins = 97
- cents50 = coins // 50
- coins = coins % 50
- print(f"50snt kolikot: {cents50}")
- print(f"Jäljelle jää {coins} snt")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement