Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
