0
NOT CONSIDERING PREVIOUS CASES
num=input("enter a num:") if num==5: print("5") elif num==11: print("11") elif num==7: print("7") else: print("nothing") *** WHY THE OUTPUT IS ALWAYS SHOWING "NOTHING" WHEN THE INPUT IS 5,7 OR 11?
2 Antworten
+ 11
Because input() returns a string by default. Try:
num = int(input("enter a num:"))
and see what happens ;)
+ 1
thanks sir