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
Related Topics
Privacy Policy, Terms and Conditions, DMCA Policy and Compliant
Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.