Bỏ qua nội dung

Lesson 8: Functions for shapes

English

Name a shape

  • A function keeps a drawing recipe under a name.
  • A parameter changes the drawing: square(50) and square(100) use the same code.

Words for this lesson

Word Meaning
function a named block of code: def square(size):
parameter a value the function gets, like size
call run the function: square(80)

Đăng nhập hoặc tạo tài khoản

IGCSE, A-Level & AP