Python的if else 巢狀 和forin while 迴圈

遺忘無寂發表於2018-06-06
bmi = weight/(height*height);
if bmi < 18.5:
    print('過輕')
elif bmi > 18.5 and bmi < 25:
    print('正常')
else:

    print('dd')

for in迴圈

names = ['Tom','Mak','Jack']
for name in names:
    print(name);
for i in range(1,5):
    print(i)
while 迴圈
while 1 == 1:  
    print(1);


相關文章