Crossin的编程教室

标题: 小白求助 [打印本页]

作者: python小白007    时间: 2018-2-1 23:06
标题: 小白求助
与孩子一起学编程

开局的那个猜数字的游戏。。。。

到了  while  这里 就敲不过去了。。。。请教大神
>>> import random,easygui
>>> secret=random,randint(1,99)
Traceback (most recent call last):
  File "<pyshell#36>", line 1, in <module>
    secret=random,randint(1,99)
NameError: name 'randint' is not defined
>>> secret=random.randint(1,99)
>>> guess=0
>>> tries=0
>>> easygui.msgbox("""sdfasdfasfadsf""")
'OK'
>>> while guess !=secret and tries <6
SyntaxError: invalid syntax
>>> while guess!=secret and tries <6





欢迎光临 Crossin的编程教室 (https://bbs.crossincode.com/) Powered by Discuz! X2.5