Sep-20-2019, 01:33 PM
Hi everyone,
I'm beginner Python coder and I'm trying the challenges on HackerRank.
I'm doing "Learn to code in 30 days " and I'm on 3 day.
this is the link :link
The compiler say that I have an error syntax on 20 line where there is else condition, but I don't know how to resolve it.
I was also wondering if my code is right or if there are other errors that I can't see.
Can you help me ?
Thank you and greetings,
RavCOder
I'm beginner Python coder and I'm trying the challenges on HackerRank.
I'm doing "Learn to code in 30 days " and I'm on 3 day.
this is the link :link
The compiler say that I have an error syntax on 20 line where there is else condition, but I don't know how to resolve it.
I was also wondering if my code is right or if there are other errors that I can't see.
Can you help me ?
Thank you and greetings,
RavCOder
import math import os import random import re import sys if __name__ == '__main__': N = int(input()) if N % 2 : print("Weird") elif N % 1 and N in range (2,5): print("Not Weird") elif N % 1 and N in range (6, 20): print("Weird") else N % 1 and N > 20: print("Not Weird")