Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions main1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 🚨 Don't change the code below 👇
height = input("enter your height in m: ")
weight = input("enter your weight in kg: ")
# 🚨 Don't change the code above 👆

#Write your code below this line 👇
w = float(weight)
h = float(height)
bmi = w/ (h*h)
print (bmi)








8 changes: 8 additions & 0 deletions main2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Create a program using maths and f-Strings that tells us how many days, weeks, months we have left if we live until 90 years old.

x = int (input ("What is your current age?"))
y = 90 - x
days = y * 365
weeks = y * 52
months = y * 12
print (f"You have {days} days, {weeks} weeks, {months} months left to live")
16 changes: 16 additions & 0 deletions main3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#If the bill was $150.00, split between 5 people, with 12% tip.

#Each person should pay (150.00 / 5) * 1.12 = 33.6
#Format the result to 2 decimal places = 33.60

#Tip: There are 2 ways to round a number. You might have to do some Googling to solve this.💪

#Write your code below this line 👇

bill = int (input ("What was the bill?"))
tip = int (input ("What percentage tip would you like to give?"))
number = int (input("How many people are going to pay the bill?"))
tip = 1 + (tip / 100)
final = (bill * tip)/ number
finall_bill = round(final, 2)
print (finall_bill)