- Type
- Quiz
- Course
- CS306 Introduction to Python
- Size
- PDF 846 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2 of 2. Download the file for all 2 pages.
Q1. Which of the following is true about iterating through a set?
Correct answer: Sets are unordered, so iteration may not follow insertion order
Q2. How can multiple elements be added to a set at once?
Correct answer: update()
Q3. What happens when a duplicate element is added to a set?
Correct answer: The duplicate is ignored
Q4. Which of the following is true about variable-length unpacking in Python?
Correct answer: The * operator captures all remaining elements during unpacking
Q5. How can you repeat the elements of a tuple (1, 2) three times?
Correct answer: (1, 2) * 3
Q6. How would you unpack a list l = [1, 2, 3] into individual variables?
Correct answer: a, b = l
Q7. What does Python's consistency refer to in handling data structures?
Correct answer: Similar operations are available for different data structures
Q8. In which scenario "set" is most useful?
Correct answer: When you need to store unique elements
Q9. Which of the following is a property of sets in Python?
Correct answer: Sets do not allow duplicate elements
Q10. How can you find the index of element 30 in a tuple t = (10, 20, 30, 40)?
Correct answer: t.index(30)
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.