Week 5 Ch 6 Flashcards
What does return do?
Returns from function and uses following expression as the value
When a return statement is executed what happens?
Function terminates
Code after a return statement is called what?
Dead code
What is composition when referring to functions?
Calling one function from within another function
What is a guardian?
Programming pattern that uses a conditional statement to check for and handle situations that could cause errors
Explain this for loop.
For a in range (1,3):
Print(a)
A range of numbers is made 1,2,3 then for each item a variable is assigned to it. During the for loop, print will print the value of a for each time it parses through the range. It ends before it reaches 3 and doesn’t print that because that’s how Python works.
Do fruitful functions have a return value of None?
No they do not