123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 You Have 2 hours To Complete The Test / Quiz Programming and Problem Solving through Python (M3-R5.1) Total available questions is More than 1000. Each exam has 100 questions & Answers randomly. You will get 2 hrs to complete the test. Its Mandatory To Fill For Get Certificate After Complete Exam. NameEmail 1) ……….design approach starts by dividing the complex algorithm into one or more modules. a. Top-Down b. None of the above c. Both of the above d. Down-Top 2) Which type of Programming does Python support? a. Object-oriented programming b. Functional programming c. All of the mentioned d. Structured programming 3) The for loop in Python is an ____ . a. Exit Controlled Loop b. Both of the above c. None of the above d. Entry Controlled Loop 4) _____ is also known as the alias array. a. alias b. array c. ndarray d. None of these 5) Python code can run on a variety of platforms, it means Python is a _____ language. a. Cross-Platform b. All of these c. Platform Dependent d. Graphical 6) Method is used to display entire contents of the file. a. readlines() b. None c. read() d. Both 7) In which language is Python written? a. PHP b. C c. All of the above d. English 8) What value does the following expression evaluate to ? print(5 + 8 * ((3*5)-9)/10) a. 10 b. 9.8 c. 10.0 d. 9.0 9) Python is a/an _________ language. a. Low Level b. Procedural c. Difficult d. High Level 10) To which of the following the “in” operator can be used to check if an item is in it ? a. Set b. Lists c. Dictionary d. All of the mentioned 11) What will be the output of the following Python code? l1=[1,2,3] l2=[4,5,6] [x*y for x in l1 for y in l2] a. [4, 10, 18] b. [18, 12, 6, 15, 10, 5, 12, 8, 4] c. [4, 5, 6, 8, 10, 12, 12, 15, 18] d. [4, 8, 12, 5, 10, 15, 6, 12, 18] 12) This symbol is used to print more than one item on a single line. a. Semicolon(;) b. comma(,) c. Colon(:) d. Dollor($) 13) What will be the output of the following Python code? l=[[1, 2, 3], [4, 5, 6]] for i in range(len(l)): for j in range(len(l[i])): l[i][j]+=10 l a. [[11, 12, 13], [14, 15, 16]] b. Error c. [[1, 2, 3], [4, 5, 6]] d. No output 14) Which of the following environment variable for Python tells the Python interpreter where to locate the module files imported into a program ? a. PYTHONCASEOK b. PYTHONHOME c. PYTHONPATH d. PYTHONSTARTUP 15) If a is declared as a=[‘me’, ‘he’, ‘they’], the value of a=””.join(a) print(a) will be ______ . a. None of these b. mehethey c. me he they d. he they me 16) What is identity array? a. This is a array with ones on the main diagonal. b. This is a normal array. c. This is a square array with ones on the main diagonal. d. None of these 17) Suppose list1 = [0.5 * x for x in range(0, 4)], list1 is: a. [0.0, 0.5, 1.0, 1.5] b. [0.0, 0.5, 1.0, 1.5, 2.0] c. [0, 1, 2, 3] d. [0, 1, 2, 3, 4] 18) What will be the output of the following Python code? >>> a={1,2,3} >>> b=a.add(4) >>> b a. None b. {1,2,3,4} c. Nothing is printed d. {1,2,3} 19) What will be the output of the following python code? from math import *  floor(11.7) a. 11.0 b. none of these c. 11 d. 12 20) The operator used for concatenating two strings. – a. * b. + c. None d. % 21) Which of the following is not a valid keyword of Python associated with loops? a. range b. break c. continue d. check 22) What will be the output of the following Python expression if x=22.19? print(“%5.2f”%x) a. 22.19 b. 22.20 c. 22.1900 d. 22.00000 23) How many keywords are there in python 3.7? a. 33 b. 32 c. 31 d. 30 24) In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type. This concept is known as a. immutability b. mutability c. dynamic typing d. static typing 25) In which year was the Python language developed? a. 1972 b. 1989 c. 1995 d. 1981 26) Which of the following is the use of function in python ? a. Functions are reusable pieces of programs b. all of these c. Functions don't provide better modularity for your application d. you can't also create your own functions 27) What will be the output of the following Python code? print("Hello {name1} and {name2}".format(name1='foo', name2='bin')) a. Hello {name1} and {name2} b. Hello foo and bin c. Error d. Hello and 28) In which year was the Python 3.0 version developed? a. 2000 b. 2005 c. 2008 d. 2010 29) The graphical representation of algorithm is a. program b. Algorithm c. statement d. Flowchart 30) The scope rule in Python are summarized as____. a. None of these b. Both of the above c. LEGB (local, enclosed,global, built-in ) d. ELGB ( enclosed, local,global, built-in). 31) What will be the output of the following Python code? i = 1 while True: if i%0O7 == 0: break print(i) i += 1 a. 1 2 3 4 5 6 b. none of the mentioned c. 1 2 3 4 5 6 7 d. error 32) In python we can change the value of variable a. Two Time b. One Time c. we can not change the value of variable d. Any Number of Time 33) ___ in Python is a counter-controlled loop. a. Both A and B b. None of the above c. for d. while 34) Write a list comprehension to produce the list: [1, 2, 4, 8, 16……212]. a. [(x**2) for x in range(0, 13)] b. [(2**x) for x in range(1, 13)] c. [(2**x) for x in range(0, 13)] d. [(x**2) for x in range(1, 13)] 35) What will be the output of the following Python code snippet? print('my_string'.isidentifier()) a. Error b. None c. True d. False 36) The method used to removes all the items at once. a. None of these b. removelist () c. clear() d. remove () 37) What will be the output of the following Python code? print("abcdef".find("cd")) a. None of the mentioned b. 2 c. True d. 3 38) Which of the following is the same as list(map(lambda x: x**-1, [1, 2, 3]))? a. [1/x for x in [(1, 2, 3)]] b. error c. [1/x for x in (1, 2, 3)] d. [x**-1 for x in [(1, 2, 3)]] 39) Which of the following precedence order is correct in Python? a. Parentheses, Exponential,Multiplication, Division, Addition, Subtraction b. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential c. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential d. Exponential,Parentheses,Multiplication, Division, Addition, Subtraction 40) Empty list indicated by which symbol. a. () b. None c. [] d. {} 41) range(3) in Python is equivalent to: a. range(1,3,0) b. range(0,3,1) c. range(1,4,1) d. range(1,3) 42) Which of the following is not true about an interpreter a. Interpreter analysis each source statement every time it is to be executed b. Interpreter generates an object program from the source program c. None of the above d. Interpreter is a kind of translator 43) What will be the output of the following Python code? lst=[3,4,6,1,2] lst[1:2]=[7,8] print(lst) a. [3,4,6,7,8] b. [3, 7, 8, 6, 1, 2] c. [3,[7,8],6,1,2] d. Syntax error 44) Find the last element of list in Python? Assume ‘bikes’ is the name of list. a. bilkes[1] b. bikes[:-1] c. bikes (:-1) d. None of the above 45) Which of the following variable declaration is incorrect? a. a?=3 b. All of these c. _a=3 d. a_=3 46) Data structure used in recursion. a. Queue b. Pointer c. Stack d. None of these 47) The output of this code is ______ . a. TrueFalse b. True c. FALSE d. 0 48) What will be the output of the following Python code? s={4>3, 0, 3–3} all(s) any(s) a. False True b. False False c. True True d. True False 49) What will be the output of the following algorithm for a=5, b-8, c=6 ? Step 1: Start Step 2: Declare variables a, b and c. Step 3 Read variables a, b and c. Step 4: If a < b If a a. stop b. b is the smallest number c. a is the smallest number d. cis the smallest number 50) Which term describes a loop that continues repeating without a terminating (ending) condition ? a. unlimited loop b. Infinite Loop c. None of these d. conditional loop 51) Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1.count(5)? a. 1 b. 0 c. 4 d. 2 52) ______ valid attribute of a file object (fp) ? a. fp.mode & fp.name b. fp.name & fp.mode c. fp.closed d. fp.size 53) What will be the output of the following Python code? r = [11, 12, 13, 14, 15, 16, 17, 18, 19] A = [[0, 10, 20], a. [0, 30, 60, 120, 160, 200, 300, 350, 400] b. Error c. 0 d. [11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 20, 30, 40, 50, 60, 70, 80, 90] 54) What will be the output of the following Python code snippet? bool(‘False’) bool() a. False False b. False True c. True True d. True False 55) _____ help programmers to create lists in a concise way. a. None of these b. Tuple c. List Comprehensions d. Dictionary 56) The _____ statement is used for exiting from the loop. a. None of these b. pass c. Continue d. Break 57) The error that can be pointed out by the compiler are a. Syntax errors b. logical errors c. None of the above d. Semantic errors 58) Which one of these is floor division? a. % b. None of the mentioned c. // d. / 59) Suppose list1 is [1, 3, 2], What is list1 * 2? a. [1, 3, 2, 1, 3] b. [2, 6, 4] c. [1, 3, 2, 3, 2, 1] d. [1, 3, 2, 1, 3, 2] 60) The ______ can be accessed only inside the function in which they are declared, whereas global variables can be accessed throughout the program body by all functions. a. Global variables b. local variables c. None of these d. datatype 61) What will be the output of the following Python code snipped if x = 1? x<<2 a. 2 b. 8 c. None of these d. 4 62) ____ operator repeats a list for the given number of items. a. + b. * c. None of these d. & 63) Strings in Python are _____ a. mutable b. None of these c. immutable d. fixed 64) What will be the output of the following pseudo code? integer a,b set a=9,b=5 a=a mod(a-3) b=b mod(b-3) print a+b a. 8 b. 9 c. 5 d. 4 65) In Python assignment of more than one behaviour to a particular function and the operation performed varies by the types of objects or arguments involved are known as_____ . a. operator overloading b. Both of the above. c. Function overloading d. None of these 66) You do not have pay Python and you can view its source code too. it means Python is _______ a. Open source b. Freeware c. Free and Open Source d. Shareware 67) What will be the output of the following Python code? >>> a={1,2,3} >>> a.intersection_update({2,3,4,5}) >>> a a. Error, no method called intersection_update for set data type b. {1,4,5} c. Error, duplicate item present in list d. {2,3} 68) What will be the output of the following Python code snippet? z=set('abc') z.add('san') z.update(set(['p', 'q'])) z a. {‘a’, ‘c’, ‘c’, ‘p’, ‘q’, ‘s’, ‘a’, ‘n’} b. {‘abc’, ‘p’, ‘q’, ‘san’} c. {‘a’, ‘b’, ‘c’, ‘p’, ‘q’, ‘san’} d. {‘a’, ‘b’, ‘c’, [‘p’, ‘q’], ‘san} 69) If we have two sets, s1 and s2, and we want to check if all the elements of s1 are present in s2 or not, we can use the function: a. s2.issubset(s1) b. s2.issuperset(s1) c. s1.isset(s2) d. s1.issuperset(s2) 70) The datatype whose representation is known are called a. concrete datatype b. Abstract datatype c. Built in datatype d. Derived datatype 71) How many numbers will be printed by the following code? def fun(a,b):   for x in range(a,b+1):     if x%3==0:       print(x,end=" ") fun(100,120) a. 6 b. 9 c. 7 d. 8 72) _______ is latest high level language. a. LISP b. MATLAB c. Ruby d. Delphi 73) What will be the output of the following Python code snippet? a = [0, 1, 2, 3] for a[0] in a: print(a[0]) a. error b. 0 1 2 3 c. 3 3 3 3 d. 0 1 2 2 74) Which of the following is not a logical operator? a. equal b. not c. and d. or 75) Is Python case sensitive when dealing with identifiers? a. yes b. none of the mentioned c. machine dependent d. no 76) What will be the output of the following Python expression if x=456? print("%-06d"%x) a. 456 b. 456000 c. 000456 d. error 77) To add a new element to a list we use which command? a. list1.addEnd(5) b. list1.add(5) c. list1.addLast(5) d. list1.append(5) 78) The operator returns the quotent after division. a. & b. // c. % d. None of these 79) Which of the following commands will create a list? a. all of the mentioned b. list1 = list([1, 2, 3]) c. list1 = list() d. list1 = [] 80) Python converts the source code into an intermediate form called _______. a. Flow lines b. ndarray c. bytecode d. return 81) The following symbol represent a. Input/Output b. Initialization c. Decision d. None of Mentioned 82) What is identity array? a. This is a array with ones on the main diagonal. b. This is a square array with ones on the main diagonal. c. None of these d. This is a normal array. 83) Which one of the following has the highest precedence in the expression? a. Multiplication b. Addition c. Exponential d. Parentheses 84) A detailed flowchart is know as a. Union b. Micro c. Stack d. Macro 85) ____ statement used for error checking. - a. Assert b. Tuple c. List d. None of these 86) What will be the output of following statement ? >>>"m"+"nl" a. 'm+nl' b. 'm n1' c. 'm' d. 'mn1' 87) _______ are user Define name a. syntax b. Identifiers c. constant d. expression 88) By using function _____ ,we can change the shape of the Numpy array in python. a. change() b. None of these c. shape () d. reshape() 89) What will be the output of the following Python code? >>> a={1,2,3} >>> b=frozenset([3,4,5]) >>> a-b a. {1,2} b. frozenset({1,2}) c. Error as difference between a set and frozenset can’t be found out d. Error as unsupported operand type for set data type 90) The process of finding errors in code is called as a. Debugging b. Running c. Testing d. Compiling 91) What is the list comprehension equivalent for: list(map(lambda x:x**-1, [1, 2, 3]))? a. [x^-1 for x in range(4)] b. [1|x for x in [1, 2, 3]] c. [-1**x for x in [1, 2, 3]] d. [x**-1 for x in [1, 2, 3]] 92) What will be the output of the following Python code snippet? print('for'.isidentifier()) a. False b. None c. True d. Error 93) A sentinel-controlled loop can be implemented using _____ a. for b. if c. Both of the above d. None 94) Which of these about a frozenset is not true? a. Mutable data type b. Allows duplicate values c. Data type with unordered values d. Immutable data type 95) What will be the output of the following Python code? print("xyyzxyzxzxyy".endswith("xyy", 0, 2)) a. False b. 0 c. 1 d. True 96) Which is the correct operator for power(x,y)? a. None of the mentioned b. X^y c. X^^y d. X**y 97) The ________ function is used to convert a string value to int. a. open() b. int c. eval d. list 98) will return the mathematical number PI from the constants module. a. None of these b. Circle() c. Math.Pi d. Pandas 99) Which symbol is used to write single line comment ? a. / b. . c. # d. ? 100) The ______ statement lets the program go through the piece of code without performing any action. a. None of these b. Range c. Get d. pass Your score is