我的儿子正在尝试使用pythonAnywhere执行一个小程序.
import random, easygui
secret = random.randint(1,99)
guess = 0
tries = 0
easygui.msgbox ("AHOY! I'm the Dread Pirate Roberts, and I have a secret!\n"
"It is a number from 1 to 99. I'll give ye 6 tries.")
while guess != secret and tries < 6:
guess = easygui.integerbox ("What's yer guess, matey?")
if not guess: break
if guess < secret:
easygui.msgbox (str(guess) + "is too low, ye scurvy dog!")
elif guess > secret:
easygui.msgbox (str(guess) + "is too high, …Run Code Online (Sandbox Code Playgroud)