In: Computer Science
Phyton Please!!
Make a program where you enter a dollar amount and the program tells you how many $5 bills and $1 bills you will receive. Don’t use a dollar amount that equality of 5.
Example:
Enter Amount: (user inserts value)
Amount Entered: $50.00
5 dollar bills: 5
1 dollar bills: 25
amount = int(input('Enter Amount: ')) fiveDollarAmount =amount // 2 oneDollarAmount = amount - fiveDollarAmount while fiveDollarAmount % 5 != 0: fiveDollarAmount -= 1 oneDollarAmount += 1 print('Amount entered: $%.2f' % amount) print('5 dollar bills: $%.2f' % (fiveDollarAmount/5)) print('1 dollar bills: $%.2f' % (oneDollarAmount))
************************************************** Thanks for your question. We try our best to help you with detailed answers, But in any case, if you need any modification or have a query/issue with respect to above answer, Please ask that in the comment section. We will surely try to address your query ASAP and resolve the issue.
Please consider providing a thumbs up to this question if it helps you. by Doing that, You will help other students, who are facing similar issue.