PYTHON
Write a python function called calc_toll() that has three different parameters such as: the current hour of time (int), whether the time is morning (boolean), and whether the day is a weekend (boolean). The function also should returns the correct toll fee (float), based on the information in the picture.
PHOTO 1: toll fee & given arguemnts with expected output
PHOTO 2: STARTER CODE
Extracted text: Weekday Tolls • Before 7:00 am ($1.15) • 7:00 am to 9:59 am ($2.95) • 10:00 am to 2:59 pm ($1.90) • 3:00 pm to 7:59 pm ($3.95) • Starting 8:00 pm ($1.40) Weekend Tolls • Before 7:00 am ($1.05) • 7:00 am to 7:59 pm ($2.15) • Starting 8:00 pm ($1.10) Ex: The function calls below, with the given arguments, will return the following toll fees: calc_toll(8, True, False) returns 2.95 calc_toll(1, False, False) returns 1.90 calc_toll(3, False, True) returns 2.15 calc_toll(5, True, True) returns 1.05
Extracted text: 1 def calc_toll(hour, is_morning, is_weekend): 2 # Type your code here. 3 4 if _name_ == '_main__': print(calc_toli(8, True, False)) print(calc_tol1(1, False, False)) print(calc_tol1(3, False, True)) print(calc_tol1(5, True, True)) 7 8 9