命题
输出多个输入中最大的元素
思路
- 输入元素个数
- 列表中输入元素,注意控制元素个数
- 输入列表中最大元素
#列表中元素个数
n=int(input("input the number digits: "))
#输入列表中元素,该段代码可用下行代替
#list[input("the list number:") for i in range(0,n))]
list=[]
for i in range(0,n):
temp=input("the list number:")
list.append(temp)
#输出结果
print("The list is :",list)
print("The max list number is :",max(list))