0
indentation problem in python code..plz help error in line 7
2 ответов
+ 1
The line after "if" has to be indented and there has to be some kind of statement that is executed if the condition is True:
if N > 100 :
print('n is > 100')
elif N % 2 !=0 :
print("Weird")
"elif" has to be on the same indentation level as "if". There's a space before the first elif in your code that has to be removed.
The condition elif N % 2 ==0 and range(2,6) doesn't make sense. What are you trying to do? Check if N is even and in the range 2-5? Then use "if N % 2 == 0 and N in range(2, 6)"
0
Thanks