What is the syntax to call a function?

#to call a function
<function name>(<arguments passed to parameters, if any>)
#example with no parameters
def greetings():
     print('Hello!')
     print('Goodbye!')
greetings()

#output
Hello!
Goodbye!
#example with parameters
def customGreetings(name):
     print('Hello, ' + name)
hello('David')

#output
Hello, David

 

Advertisements