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:


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.
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Refresh Type the characters you see in this picture. Type the characters you see in the picture; if you can't read them, submit the form and a new image will be generated. Not case sensitive.  Switch to audio verification.