Skip to content

Latest commit

 

History

History
69 lines (55 loc) · 1.02 KB

File metadata and controls

69 lines (55 loc) · 1.02 KB

##Links

##Basic

def plop():
    print("PLOP")
    
plop()

PLOP

##Argument

def plop(printme):
    print("PLOP: {}".format(printme))
    
plop("Test")

PLOP: Test

##Keyword arguments

def plop(printme1, printme2):
    print("PLOP: {} / {}".format(printme1, printme2))
    
plop("a", "b")

PLOP: a / b

plop(printme2="two", printme1="one")

PLOP: one / two

##Default values

def plop(printme1, printme2="two"):
    print("PLOP: {} / {}".format(printme1, printme2))
    
plop("a")

PLOP: a / two

plop("a", "b")

PLOP: a / b

##Return

def plop(printme1, printme2="two"):
    print("PLOP: {} / {}".format(printme1, printme2))
    
result = plop("a", "b")
print(result)

PLOP: a / b None

def plop(printme1, printme2="two"):
    text = "PLOP: {} / {}".format(printme1, printme2)
    return text
    
result = plop("a", "b")
print(result)

PLOP: a / b