12. What is a Python module?
- A Python file that contains additional functions, variables, and any kind of runnable code
- A resource that provides stylistic guidelines for programmers working in Python
- A text file that contains cybersecurity-related data
- A Python function that exists within Python and can be called directly
Weekly challenge 2
13. Which of the following components are part of the header in a function definition? Select all that apply.
- The keyword return
- The name of the function
- The parameters used in a function
- The keyword def
14. Which of the following calls to the type() function uses correct syntax?
- type([55, 81, 17])
- type([17, 81]):
- type[(81, 17)]
- type[81, 55, 17]
15. Review the following code. Which of these statements accurately describes name?
def echo(name):
return name * 3
- It is a parameter because it is used in a return statement.
- It is a parameter because it is included in the function definition.
- It is an argument because it is included in the function call.
- It is an argument because it is used in a return statement.
16. Fill in the blank: The re, csv, glob, and time modules are all _____.
- keywords in a function header
- built-in functions
- part of the Python Standard Library
- part of PEP 8
18. What is returned from the following user-defined function if you pass it the arguments 2 and 3?
def add(num1, num2):
result = num1 + num2
return result
add(2, 3)
- 2
- 5
- 3
- 1
Shuffle Q/A 2
19. Which of the following choices is a resource that provides stylistic guidelines for programmers working in Python?
- re
- Python Standard Library
- PEP 8
- glob
20. What should you do when writing comments? Select all that apply.
- Keep them up-to-date.
- Make them clear.
- Only place them at the beginning of a program.
- Place them before every line of code.