Numeric comparison with user input always produces “not equal” result

后端 未结 4 1683
感情败类
感情败类 2021-01-24 17:25

I want to get a number input by the user via input() and compare it with a specific value, i.e., 3.

However, I have the impression my if statem

4条回答
  •  面向向阳花
    2021-01-24 17:40

    Python 3 input function returns string.

    Try like this

    start = input("-->: ")
    if start == "3":
        print("successful")
    

提交回复
热议问题