第 1 步:请注意,我们为您设置了场景。让我们首先询问用户想要击败多少条龙。

int()命令string转换为integer

  • ,拖入Ask for Integer
  • 将变量名称从guess更改为dragon_count
  • .ask()命令中的字符串更改为"How many dragons will I have to defeat?"

    To navigate the page using the TAB key, first press ESC to exit the code editor.

    # THIS ACTIVITY IS IN PREVIEW ONLY MODE
    • Run Code
    • 提交作品
    • 下个活动
    • Show Console
    • Reset Code Editor
    • Codesters How To (opens in a new tab)