Skip to content

set2 #5

Description

@rohit20032003

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()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions