码迷,mamicode.com
首页 > 编程语言 > 详细

Python 基础学习20151201

时间:2015-12-01 14:33:07      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:

L = [
       [Apple,Google,Microsoft],
       [Java,Python,Ruby,PHP],
       [Adam,Bart,Lisa]
    ]
#打印Apple
print(L[0][0])
#打印Python
print(L[1][1])
#打印Lisa
print(L[2][2])

age =20
if age >= 18:
  print(your age is,age)
  print(adult)
else:
  print(your age is,age)
  print(teenager) 
 
s = input(birth:)
birth = int(s)
if birth < 2000:
  print(00前)
else:
  print(00后)
  
height = 1.75
weitht = 80.5
bmi = weitht / (height*height)
print(bmi)
if bmi <18.5:
  print("过轻")
elif bmi >=  18.5 and bmi <25:
  print("正常")
elif bmi >= 25 and bmi< 28:
  print("过重")
elif bmi >= 28 and bmi <32:
  print("肥胖")
else:
  print("严重肥胖")
  
sum = 0
for x in range(101):
  sum = sum + x
print(sum)

Name = [Bart,Lisa,Adam]
for xxx in Name:
  print("Hello",xxx ,!)
b = 0
...
while b <= 2:
 print("Hello",Name[b],!)
 b = b +1

 下一步准备学习dict 和 set

Python 基础学习20151201

标签:

原文地址:http://www.cnblogs.com/hrbadmin/p/5009781.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!