Skip to content

Commit e922033

Browse files
authored
Add files via upload
1 parent a65dca8 commit e922033

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

Diff for: BMI Calculator.py

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
def user_mass():
2+
3+
user_weight = float(input('Enter your weight: '))
4+
weight_unit = input('Is the weight entered in Pounds or Kg?(Enter (P) or (Kg)): ')
5+
6+
if weight_unit.lower() == 'p':
7+
weight = user_weight * 0.4535
8+
9+
elif weight_unit.lower() == 'kg':
10+
weight = user_weight
11+
12+
return weight
13+
14+
def user_height():
15+
16+
height_choice = input('Do you want to enter your height in (Feet, Inches (F)) or (cm (c)): ')
17+
18+
if height_choice.lower() == 'f':
19+
feet = int(input('Enter the "feet" component: '))
20+
inch = int(input('Enter the "inch" component: '))
21+
22+
height = (feet * 30.48) + (inch * 2.54)
23+
24+
elif height_choice.lower() == 'c':
25+
height = float(input('Enter height: '))
26+
27+
height_in_m = height/100
28+
29+
return height_in_m
30+
31+
try:
32+
bmi = (user_mass()/((user_height())**2))
33+
34+
if bmi <= 16:
35+
print('Severly Underweight')
36+
37+
elif bmi <= 18.5:
38+
print('Underweight')
39+
40+
elif bmi <= 25:
41+
print('Healthy')
42+
43+
elif bmi <= 30:
44+
print("Overweight")
45+
46+
except ZeroDivisionError:
47+
print('Division By Zero is not Possible.\nEnter the correct height')

Diff for: acronym.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
phrase = input('Enter a phrase: ')
2+
lst_phrase = phrase.split()
3+
4+
acronym = ""
5+
6+
for i in lst_phrase:
7+
acronym = i[0] + acronym
8+
9+
print(acronym)

0 commit comments

Comments
 (0)