求助Python第35课
为什么if老是报错,<positional argument follows keyword argument>求解
import random
secret=random.randint(1,10)
times=3
guess=0
import easygui as g
while times>0:
guess=g.integerbox('不妨猜下小甲鱼现在心里想的是哪个数字(1~10):',title='数字小游戏',0,10)
times=times-1
if guess == secret:
g.msgbox('我草,你是小甲鱼心里的蛔虫吗?!')
g.msgbox('哼,猜中了也没有奖励!')
break
else:
if guess>secret:
g.msgbox("哥,大了大了~~~")
else:
g.msgbox("嘿,小了,小了~~~")
if times>0:
g.msgbox("再试一次吧:")
else:
g.msgbox("机会用光咯T_T")
g.msgbox("游戏结束,不玩啦^_^")
guess=g.integerbox('不妨猜下小甲鱼现在心里想的是哪个数字(1~10):',title='数字小游戏',lowerbound = 0,upperbound = 10)
页:
[1]