1. What is the output of the following code : print 9//2 4.5 Error 4 4 2. Program code making use of a given module is called a ______ of the module. Interface Client Modularity Docstring 3. Which function overloads the >> operator? gt() ge() rshift() more() 4. Which of these is not a core data type? Class Lists Tuples Dictionary 5. What is the output of the following program? tday=datetime.date.today() print(tday.month()) 8 Aug August 8 6. Which module in Python supports regular expressions? pyregex re regex None of the options 7. What is the length of sys.argv? number of arguments + 1 number of arguments number of arguments - 1 None of the options 8. What is the output of the following program : print 0.1 + 0.2 == 0.3 Error Machine dependent FALSE TRUE 9. To read the entire remaining contents of the file as a string from a file object infile, we use infile.readlines() infile.read(2) infile.readline() infile.read() 10. What is the output of the expression : 3*1**3 1 3 27 9 11. Suppose t = (1, 2, 4, 3), which of the following is incorrect? print(len(t)) print(max(t)) print(t[3]) t[3] = 45 12. What is the type of each element in sys.argv? tuple string list set 13. What is the output of the following program?f = Nonefor i in range (5):with open("data.txt", "w") as f:if i > 2:breakprint(f.closed) TRUE FALSE Error None 14. What is the output of the following piece of code?#mod1def change(a):b=[x*2 for x in a]print(b)#mod2def change(a):b=[x*x for x in a]print(b)from mod1 import changefrom mod2 import change#mains=[1,2,3]change(s) [2,4,6]. [2,4,6]. [1,4,9]. There is a name clash 15. What is the output of the following?x = ['ab', 'cd']print(len(list(map(list, x)))) 2 4 error None of the options 16. What is the output of the following?elements = [0, 1, 2]def incr(x):return x+1print(list(map(elements, incr))) [1, 2, 3]. error [0, 1, 2]. None of the options 17. What is the output of the following code?def foo(k):k[0] = 1q = [0]foo(q)print(q) [0]. [1]. [0, 1]. [1, 0]. 18. What is the output of the following program?line = "What will have so will"L = line.split('a')for i in L:print(i, end=' '). What will have so will [„Wh", „t will h", „ve so will"] [„What", „will", „have", „so", „will"] Wh t will h ve so will 19. What is the output of the following?elements = [0, 1, 2]def incr(x):return x+1print(list(map(incr, elements))) error [1, 2, 3]. [0, 1, 2]. None of the options 20. What is the output of the following?def to_upper(k):return k.upper()x = ['ab', 'cd']print(list(map(to_upper, x))) error [„AB", „CD"]. [„ab", „cd"]. None of the options 21. What is the output of the following code?def foo(fname, val):print(fname(val))foo(max, [1, 2, 3])foo(min, [1, 2, 3]) 3 1 error 1 3 None of the options 22. What is the output of the following program?line = "What will have so will"L = line.split('a')for i in L:print(i, end=' ') What will have so will [„Wh", „t will h", „ve so will"] [„What", „will", „have", „so", „will"] Wh t will h ve so will 23. What is the output of the following program?import stringimport stringLine1 = "And Then There Were None"Line2 = "Famous In Love"Line3 = "Famous Were The Kol And Klaus"Line4 = Line1 + Line2 + Line3print(string.find(Line1, 'Were'), string.count((Line4), 'And')) (15, 2) 15 2 True 2 True 1 24. What is the output of the following program? from math import *a = 2.13b = 3.7777c = -3.12print(int(a), floor(b), ceil(c), fabs(c)) 2 3 -3 3.12 2 3 -4 3 2 4 -3 3 2 3 -4 3.12 25. What is the output of the following program?D = dict()for i in range (3):for j in range(2):D[i] = jprint(D) TypeError: Immutable object {0: 0, 1: 0, 2: 0} {0: 1, 1: 1, 2: 1} {0: 0, 1: 0, 2: 0, 0: 1, 1: 1, 2: 1} 26. What is the output of the following program?def REVERSE(L):L.reverse()return(L)def YKNJS(L):List = list()List.extend(REVERSE(L))print(List)L = [1, 3.1, 5.31, 7.531]YKNJS(L) [1, 3.1, 5.31, 7.531] IndexError AttributeError: NoneType object has no attribute REVERSE [7.531, 5.31, 3.1, 1] 27. What is the output of the following program?D = {1 : 1, 2 : '2', '1' : 1, '2' : 3}D['1'] = 2print(D[D[D[str(D[1])]]]) 2 KeyError 3 2 28. What is the output of the following program?from math import sqrtL1 = [x**2 for x in range(10)].pop()L1 + = 19print(sqrt(L1), end = " ")L1 = [x**2 for x in reversed(range(10))].pop()L1 + = 16print(int(sqrt(L1))) 10 .0 4 10.0 4.0 4.3588 4 10.0 0 29. What is the output of the following program?import sysL1 = tuple()print(sys.getsizeof(L1), end = " ")L1 = (1, 2)print(sys.getsizeof(L1), end = " ")L1 = (1, 3, (4, 5))print(sys.getsizeof(L1), end = " ")L1 = (1, 2, 3, 4, 5, [3, 4], 'p', '8', 9.777, (1, 3))print(sys.getsizeof(L1)) 48 144 192 480 48 64 72 128 32 34 35 42 0 2 3 10 30. What is the output of the following program?L = [1, 3, 5, 7, 9]print(L.pop(-3), end = ' ')print(L.remove(L[0]), end = ' ')print(L) 5 None [1, 3, 7, 9] 5 None [3, 7, 9] 5 1 [3, 7, 9] 5 1 [3, 7, 9] 31. What is the output of the following program?T = (1, 2, 3, 4, 5, 6, 7, 8)print(T[T.index(5)], end = " ")print(T[T[T[6]-3]-6]) 5 8 4 1 4 0 5 IndexError 32. What is the output of the following program?L1 = [1, 2, 3, 4]L2 = L1L3 = L1.copy()L4 = list(L1)L1[0] = [5]print(L1, L2, L3, L4) [5, 2, 3, 4] [5, 2, 3, 4] [5, 2, 3, 4] [1, 2, 3, 4] [[5], 2, 3, 4] [[5], 2, 3, 4] [[5], 2, 3, 4] [1, 2, 3, 4] [[5], 2, 3, 4] [[5], 2, 3, 4] [1, 2, 3, 4] [1, 2, 3, 4] [5, 2, 3, 4] [5, 2, 3, 4] [1, 2, 3, 4] [1, 2, 3, 4] 33. What is the output of the following program?data = [x for x in range(5)]temp = [x for x in range(7) if x in data and x%2==0]print(temp) [0, 2, 4, 6] Runtime error [0, 2, 4] [0, 1, 2, 3, 4, 5] 34. What is the output of the following program?temp = dict()temp['key1'] = {'key1' : 44, 'key2' : 566}temp['key2'] = [1, 2, 3, 4]for (key, values) in temp.items():print(values, end = "") Runtime error {„key1": 44, „key2": 566}[1, 2, 3, 4] Compilation error None of the options 35. What is the output of the following program?data = [2, 3, 9]temp = [[x for x in[data]] for x in range(3)]print (temp) [[[2, 3, 9]], [[2, 3, 9]], [[2, 3, 9]]] [[2, 3, 9], [2, 3, 9], [2, 3, 9]] [[[2, 3, 9]], [[2, 3, 9]]] None of the options 36. Predict the output of following python programsdictionary1 = {'Google' : 1,'Facebook' : 2,'Microsoft' : 3}dictionary2 = {'GFG' : 1,'Microsoft' : 2,'Youtube' : 3}dictionary1.update(dictionary2);for key, values in dictionary1.items():print(key, values) („Google", 1) („Facebook", 2) („Youtube", 3) („Microsoft", 2) („GFG", 1) Compilation error Runtime error None of the options 37. What is the output of the following program?dictionary1 = {'GFG' : 1,'Google' : 2,'GFG' : 3}print(dictionary1['GFG']); 1 Runtime time error due to duplicate keys Compilation error due to duplicate keys 3 38. What will be displayed by the following code?def f(value, values):v = 1values[0] = 44t = 3v = [1, 2, 3]f(t, v)print(t, v[0]) 3 1 1 1 1 44 3 44 39. What is the output of the following program : print 'cd'.partition('cd') („cd", ”, ”) (”, „cd", ”) („cd") (”) 40. What is the output of the following program : print '{0:-2%}'.format(1.0 / 3) 0.33% 0.33 33% 33.33% 41. What is the output of the following program : print '{0:.2}'.format(1.0 / 3) 0.333333 0.333333:-2 0.33 Error 42. What is the output of the following program : print 'abcefd'.replace('cd', '12') ab1ef2 ab1efd ab12ed2 abcefd 43. What is the output of the following program :i = 0while i < 3:print ii += 1else:print 0 0 1 2 0 0 1 2 3 0 Error 0 1 2 44. What is the output of the following program :i = 0while i < 5:print(i)i += 1if i == 3:breakelse:print(0) 0 1 2 0 Error 0 1 2 None of the options 45. What is the output of the following program : def myfunc(a): a = a + 2 a = a * 2 return a print myfunc(2) 16 Runtime Error Indentation Error 8 46. What data type is the object below? L = [1, 23, „hello", 1] Array Dictionary List Tuple Submit Answers Retake Test More Computer Science Engineering Study Material › Computer Science Engineering Mock Tests with Answers Distributed Computing System Mock Test Software Project Management Mock TestArtificial Intelligence and Robotics Mock TestBasics of Database Management Mock TestC# Programming Mock TestC#.NET Programming Mock TestCloud Computing Mock TestCommunication Network Mock TestComputer Architecture Mock TestComputer Architecture and Organization Mock TestComputer Fundamentals Mock TestComputer Networking Mock TestComputer Networks Mock TestCPP Programming Mock TestData Analysis Mock TestData Communication and Computer Network Mock TestData Compression and Data Retrieval Mock TestData Mining and Business Intelligence Mock TestData Mining and Data Warehouse Mock TestData Structure and Algorithms Mock TestData Structures Mock TestDataBase Management System Mock TestDesign and Analysis of Algorithms Mock TestDigital Electronics and Logic Design Mock TestDigital Logic Circuits Mock TestDigital Principles and System Design Mock TestDiscrete Mathematics Mock TestDiscrete Structure Mock TestDotNet Technology Mock TestEmbedded Real Time Operating System Mock TestGreen Computing Mock TestHigh Performance Computing Mock TestInformation Cyber Security Mock TestInformation and Network Security Mock TestInformation Retrival Techniques Mock TestInformation Systems and Engineering Economics Mock TestMachine Learning Mock TestMicroprocessor and Interfacing Technique Mock TestMicroprocessors Mock TestMuli core Architectures and Pro Mock TestMulti core processors Mock TestNetwork Security Mock TestNeural Networks and Fuzzy Control Object Oriented Programming Mock TestOperating System Architecture Mock TestOperating System Mock TestProblem Solving and Python Programming Mock TestProgramming for Problem Solving Mock TestPython Programming Mock TestSoft Computing Mock TestSoftware Design Modeling Mock TestSoftware Engineering Mock TestSoftware Testing Mock TestSoftware Testing and Quality Assurance Mock TestTheory of Computation and Compiler Design Mock TestTheory of Computation Mock TestUbiquitous Computing System Mock Test Computer Science Engineering Mock Tests