Eliza Xie
0
Q:

how to use return function in python

# A Python program to return multiple   
# values from a method using dictionary  
    
# This function returns a dictionary  
def fun():  
    d = dict();   
    d['str'] = "GeeksforGeeks"
    d['x']   = 20
    return d  
    
# Driver code to test above method  
d = fun()   
print(d)  
12
#the return function is used to return a value from a function
def double(number):
    return number * 2
1
def add1(arg):
    return arg + 1
2

New to Communities?

Join the community