Skip to content

Category Archives: Python-Quizzes

Question 11: What is the output of the following program? T1 = (1)  T2 = (3, 4)  T1 += 5 print(T1) (A) TypeError (B) (1,… Read More
Question 10: What is the output of the following program? import sys  L1 = tuple()  print(sys.getsizeof(L1), end = " ")  L1 = (1, 2)  print(sys.getsizeof(L1),… Read More
Question 9: What is the output of the following program? L = [3, 1, 2, 4]  T = ('A', 'b', 'c', 'd')  L.sort()  counter =… Read More
Question 8: What is the output of the following program? L = [2e-04, 'a', False, 87]  T = (6.22, 'boy', True, 554)  for i in… Read More
Question 8: What is the output of the following program? T = 'geeks' a, b, c, d, e = T  b = c = '*'… Read More
Prerequisite: Dictionaries in PythonThese question sets will make you conversant with Dictionary Concepts in Python programming language. Question 1: Which of the following is true… Read More
Question 7: What is the output of the following program? T = (2e-04, True, False, 8, 1.001, True) val = 0 for x in T:… Read More
Question 6: What is the output of the following program? T = 'geeks'  a, b, c, d, e = T  b = c = '*'… Read More
Question 5: What is the output of the following program? tuple=("Check")*3 print(tuple)  (A) Unexpected (B) 3Check (C) CheckCheckCheck (D) Syntax Error Answer: (C) Explanation: Here… Read More
Question 4: What is the output of the following program? tuple = (1, 2, 3)  print(2 * tuple)  (A) (1, 2, 3, 1, 2, 3)… Read More
Question 3: What is the output of the following program? tuple1 = (1, 2, 4, 3)  tuple2 = (1, 2, 3, 4)  print(tuple1 < tuple2) … Read More
Question 2: What is the output of the following program? tuple = {}  tuple[(1,2,4)] = 8 tuple[(4,2,1)] = 10 tuple[(1,2)] = 12 _sum = 0… Read More
Question 1: What is the output of the following program? tuple = (1, 2, 3, 4)  tuple.append( (5, 6, 7) )  print(len(my_tuple))  (A) 1 (B)… Read More
Question 11: What is the output of the following program? set1 = set([ 4, 5, (6, 7)])  set1.update([10, 11])     print(set1)  (A) {4, 5, 6,… Read More
Question 10: What is the output of the following program? set1 = set([1, 2, 4, 4, 3, 3, 3, 6, 5])     print(set1)  (A) {1,… Read More