目标:我正在尝试创建一个可以输入 10 个数字然后吐出 10 个最大数字的程序。
我需要能够插入所有整数,然后让程序找到几率并查看其中哪个是最大的。
#Introduction
print ('Enter 10 odd numbers to see which is the greatest ')
#The big question
user_input = raw_input ('Enter a odd number ')
#Input function that only accepts intergers
numbers = []
while numbers < 11:
try:
numbers.append(int(raw_input(user_input)))
break
except ValueError:
print 'Invalid number'
#Function that finds the highest odd and sees if it is odd
highest_odd = max(user_input) and user_input % 2 != 0
print 'The largest odd number was' + str(highest_odd)