about | help | code help+videos | done | prefs |
This is just to make sure you have the system down. Write a function called test. The function should have one parameter, called x, so you'll write the function with a line "def test(x):" (without the quotation marks). On the line after the "def" line which defines the function, type two spaces then "return 2*x". This function takes a number x and doubles it, just like f(x) = 2*x in math. The reason for the two spaces is to tell Python that you want to indent. test(2) → 4 test(3) → 6 test(-1) → -2 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy