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 & AP