abhilashm86
January 21st, 2009, 06:58 AM
i am just starting to learn python,when i complied following conditonal statement,compiler gave error,i just don't find any error here
x=raw_input ('entre x value')
if x%2 == 0:
print x," is even"
else:
print x," is odd"
error by compiler,
abhilash@abhi:~$ python p1.py
entre x value 10
Traceback (most recent call last):
File "p1.py", line 3, in <module>
if x%2 == 0:
TypeError: not all arguments converted during string formatting
x=raw_input ('entre x value')
if x%2 == 0:
print x," is even"
else:
print x," is odd"
error by compiler,
abhilash@abhi:~$ python p1.py
entre x value 10
Traceback (most recent call last):
File "p1.py", line 3, in <module>
if x%2 == 0:
TypeError: not all arguments converted during string formatting