Question: The following question I need help with is below and is titled 7. Correct Change. Create a function in Python called GetChange that will accept

The following question I need help with is below and is titled "7. Correct Change."

Create a function in Python called GetChange that will accept the number of pennies, nickels, dimes and quarters. The function will then add up those values and check to see if the user has enough coins to make a whole dollar. If the user enters the right combination to make a dollar, have your function return the message CONGRATULATIONS. Otherwise return TRY AGAIN. Make sure your message is all in upper case.

For instance if the user enters the following:

  • pennies = 20
  • nickels = 5
  • dimes = 2
  • quarters = 1

Since this totals 85 cents, the message TRY AGAIN would be returned.

To test Codio will run your function. You do not need to write the code to run your function, unless your code does not pass the two tests. If your code does not pass the two tests, copy your code from Codio and paste it into either IDLE or VS Code. Then write the code to run your function to better debug and find out what is going on.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!