image
image
image

Calling a Method in Python

image

We can call a function once we have defined it from another function or program.

Calling a function simply involves typing the function name with suitable parameters.

Start IDLE.

Navigate to the File menu and click New Window.

Type the following:

welcome(‘Brenda’)

The output will be “Welcome Brenda. Lovely Day!’

Practice Exercise

Write a function that when called outputs“Hello (student name), kindly submit your work by Sunday”.