第6步:接下来我们将询问用户为什么使用该网站。根据我们的算法,我们需要第一个字母!

  • 从图形和, 将Ask放在程序的底部。
  • 将输入变量名称更改为purpose ,将字符串更改为"What do you use this website for?"

请记住,所有用户输入都是字符串! purpose是一个字符串变量,用于存储用户输入的任何文本。

索引适用于字符串和列表!在本课中,我们将使用字符串索引来构建我们的密码。

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)