Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Fix this Code This code is not running properly because of a logic problem. No matter what value we put in for money, the ouput
Fix this Code
This code is not running properly because of a logic problem. No matter what value we put in for money, the ouput do
Rewrite the ifelifelse statement so it executes properly. Use the value of to match the output under Desire
Click Run to check your code. Click Submit to submit your code to your instructor.
Your Output:
candy
soda
popcorn
money intinputHow much money do you have?"
If money candysodapopcorn:
print You can buy all three."
elif money candypopcorn:
printYou can buy candy and popcorn"
elif money candysoda:
print You can buy soda and candy"
elif money soda:
printYou can buy soda"
else:
printYou can't buy anything!"
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