Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

What is a set in Python?

View

Which of the following creates an empty set?

View

What is the output of {1, 2, 3} | {3, 4, 5}?

View

How do you add an element to a set?

View

What will be the output of {1, 2, 3} & {2, 3, 4}?

View

Can sets contain duplicate elements?

View

What is the result of {1, 2} - {2, 3}?

View

How do you remove all elements from a set?

View

What is the output of len({1, 2, 3, 2})?

View

Which operation is not supported by sets?

View

What is a set in Python?

An ordered collection of unique elements
An unordered collection of unique elements
A mutable collection of duplicates
A collection with key-value pairs

Which of the following creates an empty set?

{}
[]
set()
()

What is the output of {1, 2, 3} | {3, 4, 5}?

{1, 2, 3}
{1, 2, 3, 4, 5}
{3, 4, 5}
{4, 5}

How do you add an element to a set?

set.append()
set.add()
set.insert()
set.extend()

What will be the output of {1, 2, 3} & {2, 3, 4}?

{1}
{2, 3}
{1, 2, 3}
{}

Can sets contain duplicate elements?

Yes
No
Sometimes
Only in certain data types

What is the result of {1, 2} - {2, 3}?

{1, 2, 3}
{2}
{1}
{}

How do you remove all elements from a set?

set.clear()
set.remove()
set.del()
set.empty()

What is the output of len({1, 2, 3, 2})?

2
3
4
Error

Which operation is not supported by sets?

Union
Intersection
Indexing
Difference