return object in python
# This function returns a dictionary
def foo():
d = dict();
d['str'] = "Tutorialspoint"
d['x'] = 50
return d
print foo()
#Output
#'x': 50, 'str': 'Tutorialspoint'}
Are there any code examples left?
New code examples in category Python