Your first function

Let's start writing a really simple (close to dumb) function. We want you to completely understand the syntax and wrap your mind around them.

At the editor at the right you'll see a simple function defined. That's a valid python function. Now replace the empty string with your name (we'll learn more about strings later). For me, the function looks something like this:

def return_your_name():
    return 'Santiago'

Try the function

Now try uncommenting the lines at the bottom of the editor and using the Run Code button to see how it works. You should see your name printed out in the screen. Both examples (1 and 2) are identical. They're doing the same thing. The only difference is that the first one is just storing the value returned by the return_your_name function in an intermediate variable.

Test Cases

test function is not empty - Run Test

def test_function_is_not_empty():
    assert return_your_name() != ''

Solution 1

def return_your_name():
    return 'Santiago'
def return_your_name(): return '' # 1. Assign the returned value to a variable # your_name = return_your_name() # print(your_name) # 2. Print the value directly # print(return_your_name())