Over 10 years we helping companies reach their financial and branding goals. Onum is a values-driven SEO agency dedicated.

CONTACTS
ECET 2026 CSE

Day 45 – Night Session: Python – Tuples, Sets & Differences – ECET 2026

Python is one of the easiest yet most important topics for ECET CSE aspirants. In this session, let’s learn Tuples, Sets, and the Difference operation with examples and MCQs.


📘 Concept Notes

1️⃣ Tuples

  • Definition: Immutable ordered collection of items.
  • Declared using ().
  • Can store mixed data types.

👉 Example:

t1 = (10, 20, 30, "ECET")
print(t1[1])   # Output: 20
  • Key Properties:
    • Immutable (cannot change values after creation).
    • Supports indexing and slicing.
    • Faster than lists.

2️⃣ Sets

  • Definition: Unordered collection of unique elements.
  • Declared using {} or set().
  • No duplicate values.

👉 Example:

s1 = {10, 20, 30, 20, 10}
print(s1)   # Output: {10, 20, 30}
  • Key Properties:
    • No duplicates.
    • Unordered (no indexing).
    • Supports mathematical operations like union, intersection, difference.

3️⃣ Set Difference Operation

  • Returns elements that exist in one set but not in the other.

👉 Formula:

 A - B = { x ; | ; x \in A ; \text{and} ; x \notin B }

👉 Example in Python:

A = {1, 2, 3, 4}
B = {3, 4, 5}
print(A - B)   # Output: {1, 2}
  • Symmetric Difference: Elements present in either set but not in both.
    👉 Formula:

 A ; \Delta ; B = (A - B) \cup (B - A)

👉 Example in Python:

print(A ^ B)   # Output: {1, 2, 5}

🔟 10 Most Expected MCQs – ECET 2026 Python

Q1. Which of the following is immutable?
A) List
B) Tuple
C) Set
D) Dictionary

Q2. Tuples in Python are declared using:
A) []
B) {}
C) ()
D) set()

Q3. Which of the following stores unique elements only?
A) List
B) Tuple
C) Set
D) String

Q4. What is the output of:

t = (10, 20, 30)
print(t[2])

A) 10
B) 20
C) 30
D) Error

Q5. If A = {1,2,3} and B = {2,3,4}, then A - B = ?
A) {1}
B) {4}
C) {1,4}
D) {}

Q6. Which operation removes duplicates automatically?
A) List
B) Tuple
C) Set
D) Array

Q7. Symmetric difference of {1,2,3} and {3,4,5} is?
A) {1,2,4,5}
B) {3}
C) {1,2,3,4,5}
D) {}

Q8. Which of the following is NOT true about Tuples?
A) They are ordered
B) They are immutable
C) They allow duplicates
D) They support item assignment

Q9. Which operator in Python is used for set difference?
A) ^
B) –
C) *
D) /

Q10. What is the output of:

s = {10, 20, 10, 30}
print(len(s))

A) 2
B) 3
C) 4
D) Error


✅ Answer Key

Q.NoAnswer
Q1B
Q2C
Q3C
Q4C
Q5A
Q6C
Q7A
Q8D
Q9B
Q10B

🧠 Explanations

  • Q1 → B: Tuples are immutable.
  • Q2 → C: Tuples use round brackets ().
  • Q3 → C: Sets only store unique elements.
  • Q4 → C: Index 2 means 3rd element → 30.
  • Q5 → A: A – B = {1}.
  • Q6 → C: Sets remove duplicates automatically.
  • Q7 → A: Symmetric difference = {1,2,4,5}.
  • Q8 → D: Tuples do not support item assignment.
  • Q9 → B: - is used for set difference.
  • Q10 → B: Duplicates removed → {10,20,30} → length = 3.

🎯 Why Practice Matters

  • Python questions are direct and concept-based.
  • Tuples vs Lists vs Sets differences are commonly asked.
  • Set operations like union, intersection, difference are high scoring in exams.

📲 Join Our ECET Prep Community on WhatsApp

👉 Join WhatsApp Group – Click Here

Leave a comment

Your email address will not be published. Required fields are marked *