Use a variable · 使用变量
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 基础 · Variables · 变量 →
English
Use a variable
A variable is a named box that holds a value. name = "Sam" puts Sam in the box name. Then print(name) shows what is inside.
中文
使用变量
变量是一个有名字的盒子,用来存放一个值。name = "Sam" 把 Sam 放进盒子 name。然后 print(name) 显示盒子里的内容。
Put Sam in a box called name, then print(name). · 把 Sam 放进名为 name 的盒子,然后 print(name)。
Click Run to see the output here. · 点击“运行”查看此处输出。