temp = input("不妨猜一下小甲鱼心里想的是哪个数字:")
num = int(temp)
#input输出永远是字符串
while type(num) != type(4):
print("抱歉,输入不合法,",end='')
#end=''取消换行print默认换行
temp = input("请输入一个整数:")
列表中元素的提取和替换
list1 = [1, [1, 2, ['小甲鱼']], 3, 5, 8, 13, 18]
list1[1][2][0] = '小鱿鱼'
#list1[1][2]的结果:[1, [1, 2, '小鱿鱼'], 3, 5, 8, 13, 18]
元组推导式
import random
randomnumber = (random.randint(10,100) for i in range(10))
randomnumber = tuple(randomnumber)
print(randomnumber)