Skip to content · ⁨Pular para o conteúdo⁩

Call a function · ⁨Chamar uma função⁩

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.

Português

Chamar uma função

greet já está escrita para você. Chame-a com "Mia" para que o programa imprima "Hello, Mia".

Escrever def apenas descreve a função — nada acontece até você chamá-la pelo nome com parênteses: greet("Mia"). A chamada fica na margem esquerda, fora da def.

Log in or create account · ⁨Entrar ou criar conta⁩

IGCSE, A-Level & AP