2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-03 15:40:17 +00:00
cheat.sheets/sheets/_python/func

16 lines
333 B
Plaintext
Raw Normal View History

2017-07-18 04:49:56 +00:00
# Simple function
def functionName():
return True
# Function with parameters
def functionName(a, b):
if(a < b):
return a
else:
return b
# Return multiple values
def functionName(a, b, c):
return (a, b, c) // Returns a tuple
return {'return_a':a, 'return_b':b ,'return_c':c } // Returns a dictionary