Skip to content

Ask for two things · ⁨问两样东西⁩

English

Ask for two things

Read a colour, then an animal. Print them on one line with a space between: for red and fox, print "red fox".

Each input() reads ONE line, so two things need two calls — and each needs its own variable, or the second overwrites the first.

中文

问两样东西

先读一个颜色,再读一个动物。把它们打印在一行,中间加一个空格:输入 red 和 fox 时,打印 "red fox"。

每个 input() 只读一行,所以两样东西要调用两次 —— 而且各自要有自己的变量,否则第二个会覆盖第一个。

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

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