Start learning free

LESSON 37 OF 348 · FUNCTIONS I

Parameters & Arguments: Buggy Code I in Scala in Scala

Practice

Inside the code editor we've tried to define and call a function that takes a number as argument and prints the Double of that number to the console.

So when we ran the code, we expected it to print:

20

but it seems like we made some mistakes because when we run our code we get an error instead.


Assignment:

Your task is to fix our code such that no errors will be produced and it will print the desired output.

STEP 1 OF 1
    Ctrl + Enter to check

    Buggy Code Non Existing Variable in Scala

    Keep going with ScalaAbout 340 step-by-step lessons, from your first line of code to coding interviews. Free to start.
    Start learning free