摘要: # 请利用循环依次对list中的每个名字打印出Hello, xxx!: # -*- coding: utf-8 -*- names = ['Bart', 'Lisa', 'Adam'] for name in names: print("Hello", name, "!") 阅读全文
posted @ 2021-11-23 15:32 無心的Man 阅读(95) 评论(0) 推荐(0) 编辑
摘要: # 小明身高1.75m,体重80.5kg。请根据BMI公式(体重除以身高的平方)帮小明计算他的BMI指数,并根据BMI指数: # 低于18.5:过轻 # 18.5-25:正常 # 25-28:过重 # 28-32:肥胖 # 高于32:严重肥胖 # 用if-elif判断并打印结果: # -*- cod 阅读全文
posted @ 2021-11-23 15:12 無心的Man 阅读(761) 评论(0) 推荐(0) 编辑
摘要: # 请用索引取出下面list的指定元素 # -*- coding: utf-8 -*- L = [ ['Apple', 'Google', 'Microsoft'], ['Java', 'Python', 'Ruby', 'PHP'], ['Adam', 'Bart', 'Lisa'] ] # # 阅读全文
posted @ 2021-11-23 11:09 無心的Man 阅读(127) 评论(0) 推荐(0) 编辑