Skip to content

Ask for a name · ⁨问一个名字⁩

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() 会等你输入一行,然后把它作为文字交回来。先把它存进一个变量,再使用这个变量。

Log in or create account · ⁨登录或创建账户⁩

IGCSE, A-Level · ⁨IGCSE、A-Level⁩ & AP · ⁨与 AP⁩