I have a code and it doesnt work in hackerrank,in my python file(not in hackerrank)i used if a=input() to set a’s values but instead i set a = 0 in hackerrank that I assume hackerrank(might)change it values later on , but quickly i found out that not only out puts were different between both hackerrank and my python runner , if i changed the values of a in hacker rank such as a= 2 instead of a = 0 itll achieve different results thus making me puzzled and confused
here is the code:
n = int(input("enter an integer: "))
#the first line of code is optional
if n % 2 == 1:
print("Weird")
elif 2 <= n <= 5:
print("Not Weird")
elif 6 <= n <= 20:
print("Weird")
else:
print("Not Weird")
I tried looking for similar problems online and tried alot of solutions ,but unfortunately I am just a normal student and I cant just use half of my day to research this problem
calcoolatorz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.