Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 distances

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_2

Step: 3

blur-text-image_3

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

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions