Question: please write in / with python and note the restrictions etc thank you Task 5 Learning Objectives: Using selection statements ( if / elif /
please write inwith python and note the restrictions etc thank you
Task Learning Objectives:
Using selection statements ifelifelse
Defining functions
Using function calls
Using function return statements
Applying arithmetic operators
Assumptions
The data types of the values that are sent to the functions are the proper ones and you don't have to
validate them. Be sure to read additional assumptions made in individual problems!
Restrictions
You may:
Use arithmetic operators:
Use Boolean operators and, or etc.
Data types:int, float, str bool
Casting functions: int float str bool
You may not:
Import anything.
Use string formatting or string indexing ie stringindex
Use loops or any other features not covered in class yet. If you are unsure, ask!
Use input or print For this assignment you will be defining functions and handling
inputoutput differently. See the Testing and Functions sections below for more details.
pts Ayshu is traveling to visit her cousin who lives very far away. She is looking for the fastest travel
option that she can afford. Given her budget and the distance to her cousin's home, use the table below to
calculate the cost of travel. The most preferred mode of travel is to fly by plane because it is the fastest;
followed by train; and driving by car is the least preferred. If Ayshu cannot afford to drive, then return
'stay home'
Use this table to calculate the cost of travel:
Signature:
def bestoptionbudget miles:
#your code here
return
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
