1. When creating your own functions, which of the following aregood characteristics that make them robust, sharable, and reusable(check all that apply)
| | the function's name is suggestive of its purpose and/or actionsand includes a summary docstring |
| | the function freely uses variables in the global namespace toperform its activities |
| | the function only uses variables it is passed by calling code orit otherwise internally creates |
| | the function only performs a limited number of actions |
2. Following list is given.
L L = [20, ‘Hello’, ‘Hi’, 6, 9] |
What is the type of L[-3] = ?
3. Functions are required to have the following number ofparameters and return statements (check all that apply):
| | at least one parameter and one return statement |
| | zero or more parameters and zero or more return statements |
| | one parameter but zero or more return statements |
| | one return statement but zero or more parameters |
4. To repeat a code fixed number of times what should youuse?
| | while loop |
| | repeat loop |
| | for loop |
| | conditional structure |
5. What is the value of 'total' at the end of the code?
total = 0 numbers = [11, 1, -1, -20, 15] for number in numbers: total += number |