Call a function · 调用一个函数
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 基础 · Functions · 函数 →
English
Call a function
greet is already written for you. Call it with "Mia" so the program prints "Hello, Mia".
Writing def only describes the function — nothing happens until you call it by name with brackets: greet("Mia"). The call goes at the left margin, outside the def.
中文
调用一个函数
greet 已经替你写好了。用 "Mia" 调用它,让程序打印 "Hello, Mia"。
写 def 只是描述了这个函数 —— 在你用名字加括号调用它之前什么都不会发生:greet("Mia")。调用要写在最左边,在 def 外面。
greet is already written for you. Call it with "Mia" so the program prints "Hello, Mia". · greet 已经替你写好了。用 "Mia" 调用它,让程序打印 "Hello, Mia"。
Click Run to see the output here. · 点击“运行”查看此处输出。