Skip to content

Procedures & functions · ⁨过程与函数⁩

English

A function is a named block

  • A function is a named block of code you can run again and again.
  • Define it once with def, then call it by name.
  • This avoids repeating yourself and keeps programs tidy.
中文

函数是一个有名字的代码块

  • 函数(function)是一段有名字的代码,可以反复运行。
  • 用 def 定义一次,然后用名字调用(call)它。
  • 这样就不用重复写代码,程序也更整洁。

Handout

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

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