The toll program illustrates the use of conditional statements;
As a general rule, conditional statements are used to make decisions
<h3>The
toll program</h3>
The toll program written in Python where conditional statements are used to make several decisions is as follows:
def calc_toll(hour, morning, weekend):
toll_fee = 0
if weekend == False:
if morning == True:
if hour < 7:
toll_fee+=1.15
elif hour < 10:
toll_fee+=2.95
elif hour <= 12:
toll_fee+=1.90
else:
if hour < 3:
toll_fee+=1.90
elif hour < 8:
toll_fee+=3.95
elif hour >= 8:
toll_fee+=1.40
else:
if morning == True:
if hour < 7:
toll_fee+=1.05
elif hour <= 12:
toll_fee+=2.15
else:
if hour < 8:
toll_fee+=2.15
elif hour >= 8:
toll_fee+=1.10
return toll_fee
Read more about conditional statements at:
brainly.com/question/24833629
#SPJ1
There are many benefits to using folders when working with lots of files. Here are a few examples:
- You can use folders to sort your files by type, almost like drawers in a desk, so you might have folders for Music, Photographs, Documents, etc.
- You can use folders to group files together into a specific group. For example in your Photographs folder you might have a folder titled BirthdayPhotographs for all the photographs from your birthday.
- As in the example above you can nest folders to create sub-categories. Documents might include folders for Homework, Stories, Poems
- Folders can have different permissions applied to them, allowing you to keep personal files in a private folder only you can access, or secret files in a folder that doesn't show up in the normal list of folders!