Today I learned about Data Types, Number Operators, Type Conversions, and f-strings. At the end of today, I am going to build a Tip Calculator.
Write a program that adds the digits in a 2-digit number. e.g. if the input was 35, then the output should be 3 + 5 = 8:
Write a program that adds the digits in a 2-digit number
This code calculates BMI as weight in kg divided by height in meters squared.
Create a program using math and f-Strings that tells us how many weeks we have left, if we live until 90 years old.
Create a Tip Calculator. The program will take into account 3 different variables, total bill, tip percentage, and how many people are splitting the bill, to calculate how much each person should pay.
I had to look up how to format the bill so that it always shows 2 decimal places. The {:.2f} code forces Python to format the answer correctly.
That's a wrap for Day 2!



