1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jenyasd209 [6]
3 years ago
13

# change amount as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Do

llars, 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
Computers and Technology
1 answer:
tiny-mole [99]3 years ago
3 0

Answer:

Explanation:

The Python code provided was not producing any output because you were never printing out the coin variables that you created. The following code adds the needed print statements using the right singular or plural coin name as needed.

cents = 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

   if quarter == 0 or quarter > 1:

       print(str(quarter) + " quarters")

   else:

       print(str(quarter) + " quarter")

   if dime == 0 or dime > 1:

       print(str(dime) + " dimes")

   else:

       print(str(dime) + " dime")

   if nickle == 0 or nickle > 1:

       print(str(nickle) + " nickels")

   else:

       print(str(nickle) + " nickel")

   if penny == 0 or penny > 1:

       print(str(penny) + " pennies")

   else:

       print(str(penny) + " penny")

coin_change(cents)

You might be interested in
Which payment method typically charge is the highest interest rates?
jek_recluse [69]

The highest amount is Credit. The more you wait the higher the interest, higher the interest the more you pay, and no one wants to play more. Stay safe use debit as much as you can

8 0
3 years ago
What is the instruction phase of the central processing unit​
belka [17]

Answer:

The instruction cycle (also known as the fetch–decode–execute cycle, or simply the fetch-execute cycle) is the cycle that the central processing unit (CPU) follows from boot-up until the computer has shut down in order to process instructions.

7 0
3 years ago
What is the use of technology to enable people to learn anytime and anywhere​
tamaranim1 [39]

Answer:

Electronic Learning Model, refers to a type of learning that happens anytime, anywhere and with anyone.

Explanation:

With anytime and anywhere learning, education extends beyond the classroom and the traditional school day. Students are able to create, track and manage their own learnings. Instead of using printed workbooks that are quickly outdated, students can access current information.

4 0
3 years ago
How are PivotCharts different from regular charts?
AnnZ [28]

Answer:

The answer is a on edge2020.

:D have a great day and stay safe <3.

6 0
3 years ago
Which statement indicates that a personal computer is a good not a service?
koban [17]

Answer:

are there A,B,C and D answers to the question I need the statements

7 0
4 years ago
Read 2 more answers
Other questions:
  • The salesperson in a cell phone store is telling me that the phone I'm considering has 8GB of memory, which means I can save 10,
    13·1 answer
  • ) write a program that creates a vector of string called "vec". vector "vec" grows and shrinks as the user processes the transac
    6·1 answer
  • Does anyone have game design in connections
    13·1 answer
  • "Two technicians are discussing FWD driveshaft service. Technician A says that removal of the driveshaft usually requires partia
    15·1 answer
  • NEED ASAP!!
    14·1 answer
  • Give one example of a civil engineering structure.
    5·1 answer
  • In recent years, the amount of time people spend using electronic devices has sharply increased. What are the benefits and downs
    7·1 answer
  • What are the disadvantages of using photo editing software in photography?
    14·1 answer
  • Select the correct answer.
    14·1 answer
  • What features should you present when demonstrating 2023 murano’s confident cornering?.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!