目标:我正在尝试创建一个可以输入10个数字然后吐出10个最大数字的程序。我有麻烦的Python功能,有人可以帮助我吗?
我需要所有能够插入的整数,然后让程序找到可能性并查看其中哪些最大。
#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)
如果你想在10个号码,然后吐出的10大,你可以打印你的输入。 – Marcin
_“我需要所有能够插入的整数,然后让程序找到可能性并查看其中哪些是最大的。这是我的尝试,但它不起作用。”_什么部分不起作用?你认为问题在哪里? –