def calculate_change(amount):
denominations = [500, 100, 10, 5, 2, 1]
change = []
for denomination in denominations:
while amount >= denomination:
amount -= denomination
change.append(denomination)
return change
total_amount = 1234
change_result = calculate_change(total_amount)
print(change_result)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
def calculate_change(amount):
denominations = [500, 100, 10, 5, 2, 1]
change = []
for denomination in denominations:
while amount >= denomination:
amount -= denomination
change.append(denomination)
return change
total_amount = 1234
change_result = calculate_change(total_amount)
print(change_result)