Skip to content

Ntopo1/Python-Day2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 

Repository files navigation

Python: 100 Days of Coding Challenge: Day 2

Description

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.


Task 1:

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:

addition



Task 2:

Write a program that adds the digits in a 2-digit number


BMI


This code calculates BMI as weight in kg divided by height in meters squared.



Task 3:

Create a program using math and f-Strings that tells us how many weeks we have left, if we live until 90 years old.

f-string

Task 4:

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.

Tip


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!


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors