Featured
-
No Featured Found!
Tags
Returning Multiple Values in Python using Dictionary?
# A Python program returning multiple values from a method using dictionary
# Function is define that returns a dictionary
def fun():
d = dict();
d['str'] = "Demo"
d['x'] = 20
return d
# Driver code to test abo...
Returning Multiple Values in Python using tuple?
# A Python program returning multiple values from a method using tuple
# Function is defined that returns a tuple
def fun():
str = "Demo"
x = 20
return str, x; # Returning a tuple
# Driver code to test above method
...
Returning Multiple Values in Python using list?
# A Python program returning multiple values from a method using list
# Defining a function which returns a list
def fun():
str = "Demo"
x = 20
return [str, x];
# Driver code to test above function
list = fun() ...