GATE DA 2025 — Question 47

Programming, Data Structures and AlgorithmsProgramming in PythonMCQ2 marks · −2/3 if wrongMedium

Consider the following Python code snippet.
python
1A={"this","that"}
2B={"that","other"}
3C={"other","this"}
4while "other" in C:
5    if "this" in A:
6        A,B,C=A-B,B-C,C-A
7    if "that" in B:
8        A,B,C=C|A,A|B,B|C
9
When the above program is executed, at the end, which of the following sets contains "this"?
  1. A
    Only A
  2. B
    Only B
  3. C
    Only C
  4. D
    A, C
Practise the full 2025 paper
Challenge a friend: WhatsApp Telegram
From RENYXERAPractise this subject in the exam simulatorTimed, GATE-style tests with analytics that find your weak topics.
Practise more on Programming in PythonTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group