Skip to content

Your first function · ⁨你的第一个函数⁩

English

Your first function

Up to now you printed things. A function is a small machine: you give it an input and it returns an answer. You write the inside; the checker tries it with several inputs.

return hands the answer back. Complete double so it returns n times two.

中文

你的第一个函数

到现在为止你都在打印东西。函数是一台小机器:你给它一个输入,它就返回一个答案。你来写里面的内容;检查器会用多个输入来测试它。

return 把答案交回去。完成 double,让它返回 n 的两倍。

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

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