Question 120Asked in DSSSB TGT Computer Science, 7 Feb 2024, Shift 2 (12:30 PM)

Choose the correct output for the following Python code. tuple_var_mix = (“Example”, 1, “Tuple”)

Choose the correct output for the following Python code. tuple_var_mix = (“Example”, 1, “Tuple”) print (tuple_var_mix)
  1. A{Example, 1, Tuple}
  2. B(Example, 1, tuple)
  3. C(‘Example’, 1, ‘Tuple’)
  4. D[Example, 1, ‘Tuple’]
Show answerHide answer

Correct answer: (C) (‘Example’, 1, ‘Tuple’)

Explanation

print() of a tuple shows its repr: parentheses, with strings in single quotes, so the output is ('Example', 1, 'Tuple').

From DSSSB TGT Computer Science PYQ, 7 Feb 2024, Shift 2 (12:30 PM)

This is question 120 of DSSSB TGT Computer Science PYQ, 7 Feb 2024, Shift 2 (12:30 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.