Home >>Python Keywords >Python return Keyword

Python return Keyword

Python return Keyword

Python return keyword is a case-sensitive in python and used to return a value to the calling function.

Here is an example of Python return Keyword:

def myfunction():
  return 9+5
print(myfunction())

Output:
14
Example 2:

class Test: 
def __init__(self): 
	self.str = "phptpoint"
	self.z = 50 
def fun(): 
	return Test() 
e = fun() 
print(e.str) 
print(e.z)

Output:
phptpoint
50