The following code is an example of how declaring a function with Python 3:
def myFunction(name): print("Hello " + name + "!")
Then to use it:
myFunction("YOU")
It will display:
Hello YOU!
We can note that there is neither semicolon at the end of a code line nor curly brackets.
Only indentation!
© Badprog - I want to change the world. And I will.
Add new comment