TB1 Week 10


The return keyword in a function allows the function to return and variables assigned to the keyword, this is used when you want to call the function using a variable.

E.g.

def printName(name):

print(name)

def Name():

    return “John”

printName(Name())

#a will go into Name() then find out it returns John and assign John to a

a = Name()

print(a)

#This will print John as a now equals John

printName(a)

Leave a comment

Log in with itch.io to leave a comment.