Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Chained Conditional Challenge We're still deciding on our snacks. In this challenge, you are to: Write a single chained conditional statement which checks to see

Chained Conditional
Challenge
We're still deciding on our snacks.
In this challenge, you are to:
Write a single chained conditional statement which checks to see if we have enough money to buy two combinations of snacks.
First check candy and popcorn. If we do, then print out the statement "Go ahead and buy candy and popcorn."
Next, check candy and soda. If we do, then print out the statement "Go ahead and buy candy and soda."
Otherwise, print the string "Too bad! You do not have enough money."
Run the code
Input 11 as your dollar amount
This should match the output under Desired Output.
Click Run to check your code. Click Submit to submit your code to your instructor.
candy -5
soda -5
popcorn =7
# Get our money
money - int(input("How much money do you have?"))
# Write your if-else statement below!
Your Output:
Desired Output:
Go ahead and buy candy and soda.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

What is meant by Career Planning and development ?

Answered: 1 week ago

Question

What are Fringe Benefits ? List out some.

Answered: 1 week ago