Home | | Computer Science 12th Std | Calling a Function

Python - Calling a Function | 12th Computer Science : Chapter 7 : Core Python : Python Functions

Chapter: 12th Computer Science : Chapter 7 : Core Python : Python Functions

Calling a Function

When you call the “hello()” function, the program displays the following string as output:

Calling a Function

To call the hello() function from example 7.2-1, you use this code:

When you call the “hello()” function, the program displays the following string as output:

Output

hello – Python

Alternatively we can call the “hello()” function within the print() function as in the example given below.

Example:

def hello():

print (“hello - Python”)

return

print (hello())

If the return has no argument, “None” will be displayed as the last statement of the output.

The above function will output the following.

Output:

hello – Python

None

 

Tags : Python , 12th Computer Science : Chapter 7 : Core Python : Python Functions
Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
12th Computer Science : Chapter 7 : Core Python : Python Functions : Calling a Function | Python


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2024 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.