且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python猜数字游戏

更新时间:2023-02-02 21:40:37

您在 while 循环之前要求用户输入.

You are asking for the user input before the while loop.

guess = int(raw_input('Take a guess and hit enter')) 

这个语句应该出现在 while 块中.

This statement should come within the while block.

函数 raw_input 返回一个字符串,你应该把它转换成一个整数.您可以在文档中阅读更多相关信息.

The function raw_input returns a string, you should convert it to an integer. You can read more about it in the Documentation.