Ask for a name · 问一个名字
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · 此页面需较新浏览器(支持 SharedArrayBuffer)。请升级 Chrome、Edge、Firefox 或 Safari 至最新版本。
This one builds on a lesson you haven't finished yet. Do that lesson first: · 此任务基于您尚未完成的课程。请先完成以下课程:
Python Basics · Python 基础 · Getting input · 获取输入 →
English
Ask for a name
Read a name with input() and print "Hello, " then the name. For the input Mia, print "Hello, Mia".
input() waits for one line and hands it back as text. Store it in a variable first, then use that variable.
中文
问一个名字
用 input() 读取一个名字,然后打印 "Hello, " 加上名字。输入 Mia 时,打印 "Hello, Mia"。
input() 会等你输入一行,然后把它作为文字交回来。先把它存进一个变量,再使用这个变量。
Read a name with input() and print "Hello, " then the name. For the input Mia, print "Hello, Mia". · 用 input() 读取一个名字,然后打印 "Hello, " 加上名字。输入 Mia 时,打印 "Hello, Mia"。
Click Run to see the output here. · 点击“运行”查看此处输出。