Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Help me finish the rest of this code. Decisions with two options program.py> weather input (Is it currently raining? ) if weather Yes Write a
Help me finish the rest of this code.
Decisions with two options program.py> weather input ("Is it currently raining? ") if weather "Yes" Write a program to tell you which method of transport to use for your next outing. print("You should take the bus.") elif weatherNo" The first step in this decision is based on the weather. If it is currently raining, you should take the bus. km=int(input ("How far in do you need to travel? ") elif km >= 10: print("You should take the bus.") If it is not currently raining. your method of transport should be determined by the distance you need to travel. If the distance is greater than 10km, you should take the bus. If it is between 2km and 10km (inclusive), you should ride your bike, and if it less than 2km, you should walk. The distance should always be a whole number elif weather "No": km=int (input ("How far in kn do you need to travel? ") elif km >= 10: print(You should take the bus." Your program should only ask for the distance if it is relevant to the answer. That is, if it is raining, it shouldn't ask you how far you need to travel. Is it currently raining? Yes You should take the bus. Is it currently raining? No How far in km do you need to travel? 8 You should ride your bike Submissions Output Autosaved Is it currently raining? No How far in km do you need to travel? 1 You should walk Saved manually Saved manually Saved manually Saved manually The answers provided will always be Yes, No or a whole number for distancesStep 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