Python simple number comparison

前端 未结 2 1199
粉色の甜心
粉色の甜心 2020-12-22 03:22

The problem:

The computer randomly generates a number. The user inputs a number, and the computer will tell you if you are too high, or too low. Then you will get to

2条回答
  •  再見小時候
    2020-12-22 03:42

    your user variable is string type because raw_input() returns string, change your code like:

    user = int(raw_input('> '))
    

    So user would be integer.

提交回复
热议问题