Quiz Answer Key and Fun Facts
1. Which of these is a Python control flow statement type?
2. Which of these structures does not exist in Python?
3. We start writing a program to compute the square of the first n numbers, where n is a number to be input by the user. But unfortunately, we do not have the ability to store the list in memory! Which of these functions would I use to bypass this constraint?
4. How would I decorate a class method if I wanted to use it without initializing a class?
5. Since lists are mutable, which of these methods would I use to add an element to the list?
6. Suppose we wanted to use a function A from library B, where A is a top-level function. Which of these is the correct way to import *only* A?
7. Which of these simple functions reverses a string, which is set to the variable a?
8. What does Python's 'set' data structure do?
9. Sometimes while performing file input/output, programmers forget to close the file, leading to errors and corrupted data. Which of the following can we do to prevent this?
10. When we run our code, we keep getting an error and our code stops running. Which one of these keyword pairs can we use to catch the error and bypass it to keep the code running?
Source: Author
lordingtar
This quiz was reviewed by FunTrivia editor
WesleyCrusher before going online.
Any errors found in FunTrivia content are routinely corrected through our feedback system.