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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started