← Quiz: Python Interview Programs: all 13 questions
Quiz: Python Interview Programs · Question 8 of 13
What does this print? (code)
What does this print?
nums = [3, 7, 1, 9, 4]
print(sorted(set(nums))[-2])
- A.7
- B.9
- C.4
- D.An error
Answer & explanation
Correct answer: 7
The second largest unique value.
Can you get the rest right without peeking?
Take the timed Quiz: Python Interview Programs quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →