Functions
I LOVE DOING THIS :)
A function is a block of code that takes in some data and, either performs some kind of transformation and returns the transformed data, or performs some task on the data, or both
How to create and call a Function
Keyword def
: This is the keyword used to say that a function will be defined now, and the next word that is there, is the function name
Note that arguments 10 and 10 have been passed. Hence, the return value will be 20. You can put any two numbers in place of 10 and 10, and it will return the corresponding sum of the two numbers.
Last updated