Python 3 - Function - Declaration

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! surprise

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.