Professional Documents
Culture Documents
CH 5
CH 5
Functions
3-0
3-0
3-0
3-0
3-0
3-0
Function Call
3-0
3-0
3-0
3-0
# generates a random number in the [0, 10, 20, 30, 40, 50, 60, 70, 80,
90, 100]
number = random.randrange(0, 101, 10)
Concept:
6-0
def
function_name():
statement
statement
etc.
return
expression
Parts of the
function
6-0
6-0
6-0
def get_name():
# Get the user’s first and last name.
first = input(‘Enter your first name: ‘)
last = input(‘Enter your last name: ‘)