I can't get my head around this particular if..else
statement:
print("Do you want to run the next bit of code? Y/N")
n = input()
if n == "Y" or "y":
j = [12, 43, 54, 65]
for i in j:
print (i, end="" "\t")
elif n == "N" or "n":
print("You get numbers if you had pressed Y")
else:
print("That's not an option")
My problem here is, whatever the value I give for n
, it always gives me the output of Y
or y
. I always get the output as the array numbers. Which means that my condition is not working. So what is actually the problem with the first condition?