Skip to content

Commit 2b034d6

Browse files
committed
dict and set
1 parent 5e525a2 commit 2b034d6

4 files changed

Lines changed: 40 additions & 0 deletions

File tree

BMI.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
height = input("height in meter: ")
2+
height = float(height)
3+
weight = input("weight in kg: ")
4+
weight = int(weight)
5+
BMI = weight/(height*height)
6+
if BMI < 18.5:
7+
print('过轻')
8+
elif BMI < 25:
9+
print('正常')
10+
elif BMI < 28:
11+
print('过重')
12+
elif BMI < 32:
13+
print('肥胖')
14+
else:
15+
print('严重肥胖')

age.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
age = 3
2+
if age >= 18:
3+
print('your age is', age)
4+
print('adult')
5+
elif age >= 6:
6+
print('teenager')
7+
else:
8+
print('kid')

birth.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
s = input('birth: ')
2+
birth = int(s)
3+
if birth < 2000:
4+
print('00前')
5+
else:
6+
print('00后')

sum.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
sum =0
2+
for x in range(101):#[1,2,3,4,5,6,7,8,9,10]:
3+
sum = sum +x
4+
print(sum)
5+
6+
sum =0
7+
n=90
8+
while n>0:
9+
sum=sum+n
10+
n=n-2
11+
print(sum)

0 commit comments

Comments
 (0)