1/9
These flashcards cover key concepts and questions regarding functions in Python, as presented in the lecture notes.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No study sessions yet.
What does a function that does not return a value return by default?
None
What must a function header include?
Function name and parameter list.
Can a function have no parameters?
Yes, a function may have no parameters.
What symbol is used to invoke functions' arguments?
Parentheses.
Does the below function call cause syntax errors? import math def main(): math.sin(math.pi) main()
No.
What is the memory area where parameters and local variables are stored called?
A stack.
Which of the following functions should be defined as a None function?
Write a function that prints integers from 1 to 100.
What does a function with no return statement return?
None.
What should the missing function body be in def f(number): # Missing function body?
return number.
How can you correctly invoke a function defined as def f(p1, p2, p3, p4)?
f(1, 2, 3, 4).