标签:列表 bbb number list pre for ever 案例 app
"""这是第四章的案例题"""
magicians = ["alice","david","carolina","eric","alex"] #创建一个列表
mes = "see you happy." #赋值一个字符串给变量
for magician in magicians:#一个for循环 ,":"告诉python下一行是循环的第一行
print(magician + " , " + mes)
print("see you anange " + " " + magician + ".\n" )
print("thank you ,everyone .that was a great magic show!")
for value in range(1,5):# 打印出数字组列表
print(value)
number = list(range(1,6))# 使用list 函数将rang 的组生产列表
print(number)
enev = list(range(0,11,2))
print(enev)
‘‘‘
squers = []
for value in range(1,11):
square = value**10
squers.append(square)
print(squers)
‘‘‘
‘‘‘
squers = []
for value in range(1,11):#使用for 循序遍历range 函数内生产的数组
squers.append(value**2)#使用列表方法“append”新增数字到列表中
print(squers)
‘‘‘
squers = []
for i in range(1,101):
squers.append(i)
print(squers)
print(min(squers))
print(max(squers))
print(sum(squers))
print(len(squers))
a = ["alex" ,"bbb"]
print(a)
标签:列表 bbb number list pre for ever 案例 app
原文地址:https://www.cnblogs.com/upuser/p/13156159.html