Why am I getting the error **not all arguments converted during string formatting** in my python code?

Question:

I searched about it and the other person who posted a similar issue had a typo error but I can’t find that in mine.strong text

here’s the code –

num = raw_input("Enter any number: ")
def is_even(x):
    if x % 2 == 0:
        return True
    else:
        return False
print is_even(num)
Asked By: Ennv

||

Answers:

Convert your raw_input to int

Ex:

num = int(raw_input("Enter any number: ")) 
def is_even(x): 
    if x % 2 == 0: 
        return True 
    else: 
        return False 
print is_even(num)
Answered By: Rakesh
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.