2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-05 12:00:16 +00:00
cheat.sheets/sheets/_python/func
2017-07-17 21:49:56 -07:00

16 lines
333 B
Plaintext

# 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