Return Multiple Values From a Function in Python

(Last Updated On: 02/12/2022)

Python Program to Return Multiple Values From a Function

# Return Multiple Values From a Function in python
 
def name():
	return "Multiple","Values"

# print the tuple with the returned values
print(name())

# get the individual items
name_1, name_2 = name()
print(name_1, name_2)

Output:

('Multiple', 'Values')
Multiple Values

Leave a Reply

Your email address will not be published. Required fields are marked *