learning from 100 Days of Code: The Complete Python Pro Bootcamp for 2022
Data Type : int( ) / float( ) / str( )
Type Checking : type( )
Type Error : input( ) = string 、 f string = print(f"{ }")
Calculate / round( 1.666666 , 2) = 1.67
# BMI Calculator
height = input("enter your height in m: ")
weight = input("enter your weight in kg: ")
w = int(weight)
h = float(height)
print(int(w/h**2))
# Life in Weeks
age = input("What is your current age?")
x =(90- int(age))*365
y =(90- int(age))*52
z = (90- int(age))*12
print(f"You have {x} days, {y} weeks, and {z} months left.")
# tip-calculator
print("Welcome to the tip calculator!")
pay = float(input("What was the total bill? $"))
tip = int(input("How much tip would you like to give? 10, 12, or 15? "))
person = int(input("How many people to split the bill?"))
bill = pay * ((tip/100)+1) / person
bill_final = round(bill, 2)
print(f"Each person should pay: $ {bill_final}")