Lab 1: Python 1

Lab Description:

In this lab, I have completed the lesson on Python Syntax. From this lesson, I have learn how to use Python to make a simple calculator to calculate the tip for a meal. Taking the steps in this lesson, it has guide me through the lesson to calculate the tax and tips on this certain meal. First, I put in the variable of the meal. Then, put in the variable of the tax. Then, put in the variable of the tip. Then, I reassign meal to equal the total amount with tax and the total amount with tips. Finally,  the last step, Python help print the last line which does the math to calculate the total amount for the meal with tax and tip included.

Code:

meal = 44.50

tax = 0.0675

tip = 0.15

meal = meal + meal * tax

total = meal + meal * tax

# Assign the variable total on line 8!

meal = 44.50
tax = 0.0675
tip = 0.15

meal = meal + meal * tax
total = meal + meal * tip

print(“%.2f” % total)

 

ScreenShots:

Lab1