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. · לחץ על הרץ כדי לראות את התוצא כאן.