+1

Simple Question.I entered 7. Why is the program not printing 7, True. It is printing 7,False

a=input("enter a number") print (a) print(a==7)

9/1/2019 8:06:29 AM

Yogi Next door

2 Answers

New Answer

+6

because "7" != 7 input() returns a string to compare it in the right way with a integer (7) you need to convert it using the function int() like this: Simple Question.I entered 7. Why is the program not printing 7, True. It is printing 7,False a=int(input("enter a number")) print (a) print(a==7)

+1

thanks a lot 🙏🏼⭐️