subject

# change amount as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies my code produces no output and i cant find why?

coin_change =int(input())

def coin_change(cents):
if cents <= 0:
print( 'Zero cents.')
else:
quarter = cents // 25
dime = (cents % 25) //10
nickle = cents % 25 % 10 // 5
penny = cents % 5

print (coin_change )
# produces no output

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 00:10, witerose701
Write a function so that the main0 code below can be replaced by the simpler code that calls function mphandminutes tomiles0. original main0 int main) l double milesperhour-70.0; double minutestraveled = 100.0; double hourstraveled; double milestraveled; hourstraveled = minutestraveled / 60.0; milestraveled = hourstraveled * milesperhour; cout < "miles" 2 using namespace std; 4 /* your solution goes here/ 6 int maino 1 test passed 7 double milesperhour 70.0 all tests passed 8 double minutestraveled 100.0; 10 cout < < "miles: " < < mphandminutestomiles(milesper-hour, minutestraveled) < < endl; 12 return 0; 13
Answers: 1
image
Computers and Technology, 23.06.2019 01:30, solikhalifeoy3j1r
In deadlock avoidance using banker’s algorithm, what would be the consequence(s) of: (i) a process declaring its maximum need as maximum possible for each resource. in other words, if a resource a has 5 instances, then each process declares its maximum need as 5. (ii) a process declaring its minimum needs as maximum needs. for example, a process may need 2-5 instances of resource a. but it declares its maximum need as 2.
Answers: 3
image
Computers and Technology, 23.06.2019 17:30, cxttiemsp021
Per the municipal solid waste report, what are the most common sources of waste (trash
Answers: 3
image
Computers and Technology, 23.06.2019 18:30, emmaishere69
List 3 items that were on kens resume that should have been excluded
Answers: 1
You know the right answer?
# change amount as an integer input, and output the change using the fewest coins, one coin type per...

Questions in other subjects:

Konu
English, 20.05.2021 20:50
Konu
Mathematics, 20.05.2021 20:50
Konu
Mathematics, 20.05.2021 20:50
Konu
Mathematics, 20.05.2021 20:50
Konu
Mathematics, 20.05.2021 20:50
Konu
Mathematics, 20.05.2021 20:50
Konu
Mathematics, 20.05.2021 20:50