Menu
support@authoritypapers.com
+1(805) 568 7317

1 we have a small program which checks if the day of the week assigned to the variab 5148702

1)We have a small program which checks if the day of the week, assigned to the variable day, is a weekend day. However, it isn't very efficient. Instead of using elif, we should use the or logical operator to check if the day is Saturday OR Sunday. Re-write this code to do just that. When you are finished, it should match the output under Desired Output.

# Set Variables
day = “Tuesday”

# Let's see if it is the weekend!
if day == “Saturday” or “Sunday”
    print(“It is the weekend!”)
elif day == “Sunday”:
    print(“It is the weekend!”)
else:
    print(“It is not the weekend!”)

Desired output:

It is not the weekend!

2) Now we're checking to see if the day of the week is a Wednesday. Re-write the conditional statement so the first condition uses the not logical operator to check if the day is not a Wednesday. When you are finished, your output should match the output under Desired Output.

Set Variables
day = “Friday”

# Let's see if it is the weekend!
if day == “Wednesday”:
    print(“It is hump day!”)
else:
    print(“It is not hump day!”)

desired output:

It is not hump day!

3) Our print function is not displaying items amounts properly – the numbers are just too big. Use the format function to fix this code so the output matches the output under Desired Output.

items_per_day = 16328
days = 365
total_items = items_per_day * days
print(“Total Items:”, total_items)

desired output:

Total Items: 5,959,720

"Order a similar paper and get 15% discount on your first order with us
Use the following coupon
"GET15"

Order Now