目標: 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)