cs50python icon indicating copy to clipboard operation
cs50python copied to clipboard

set2

Open rohit20032003 opened this issue 1 year ago • 0 comments

coke correct code def main(): cost = 50 due = cost

while due > 0:
    print(f'Amount Due: {due}')
    coin = int(input('Insert Coin: '))
    if coin in [25, 10, 5]:
        due -= coin

# Calculate change if any amount overpaid
if due < 0:
    change = -due
else:
    change = 0

print(f'Change Owed: {change}')

if name == "main": main()

rohit20032003 avatar Jun 28 '24 09:06 rohit20032003