Your first function · دالتك الأولى
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 في اثنين.
Write a function. Complete double(n) so it returns n times two. · اكتب دالة. أكمل double(n) لتُرجع n مضروباً في اثنان.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.