Skip to content

Latest commit

 

History

History
executable file
·
28 lines (19 loc) · 744 Bytes

File metadata and controls

executable file
·
28 lines (19 loc) · 744 Bytes
tutorial

03 What is a function?

You can see a function as a fragment of code we can use several times.

For example: If we want to get the sum of two numbers, we can declare a function called sum that returns the sum of number1 and number2:

def sum(number1,number2):
    return number1 + number2

After the function is declared, we can use it as many times as we want, like this:

total = sum(2,3)
total2 = sum(5,10)

print(total)  # Prints 5 on the console
print(total2)  # Prints 15 on the console

📝 Instructions:

  1. Please calculate the sum between 3445324 and 53454423 and assign the result to a variable called super_duper.