I'm trying to write a program that asks the user for 4 integers and prints the largest odd number that was entered. Here is the code:
a = raw_input("Enter an int: ")
b = raw_input("Enter an int: ")
c = raw_input("Enter an int: ")
d = raw_input("Enter an int: ")
numbers = [a, b, c, d]
odd_numbers = []
print numbers
for i in numbers:
if i%2!=0:
odd_numbers.append(i)
else:
print "This is not an odd number."
for nums in odd_numbers:
max_num = max(odd_numbers)
print max_num
And here is the error that I'm receiving:
line 10, in <module>
if i%2!=0:
TypeError: not all arguments converted during string formatting
What am I doing wrong ?