阅读背景:

如何在if语句中使用randint的输出(Python)

来源:互联网 

I'm learning Python (3.6.3) and making a silly (and very linear) chatbot to get started. At one point the chatbot asks you to guess its age, I used randint to generate a number between 1-1000 and want to use the outputted random integer in an if statement (so the chat bot is either happy or upset by your answer, depending on whether you thought it was older than it really is). The user's input is a var called guess and I assumed (as I cannot find a similar example online) that I could just reference guess and the randint in an if statement to print the desired output, but I get an error advising radint is not defined when I run the prog -I'm learning Python (3.6.3) and making a silly




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: