| tutorial | https://www.youtube.com/watch?v=tgTLyZ0cKj4 |
|---|
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 + number2After 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- Please calculate the sum between 3445324 and 53454423 and assign the result to a variable called
super_duper