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) What will be the output of the following Python code snippet? x = 'abcd' for i in range(len(x)): i[x].upper() print (x) a. none of the mentioned b. abcd c. error d. ABCD 2) ______ are the modes of both writing and reading in binary format in file. a. None of these b. rb+ c. bw+ d. bw+ 3) What plays a vital role in Python programming? a. Structure b. Indentation c. Control d. Statements 4) What will be displayed by print(ord(‘b’) – ord(‘a’))? a. 2 b. 1 c. -1 d. 0 5) To which of the following the “in” operator can be used to check if an item is in it ? a. Dictionary b. Lists c. All of the mentioned d. Set 6) What will be the output of the following Python code? print("xyyzxyzxzxyy".endswith("xyy")) a. 1 b. True c. 2 d. 3 7) If the else statement is used with a while loop, the else statement is executed when the condition becomes _____ . a. NULL b. Infinite c. True d. False 8) What will following code segment print? a=True b=False c=False if not a or b: print(1) elif not a or not b and c: print(2) elif not a or b or not b and a: print(3) else: print(4) a. 1 b. 2 c. 4 d. 3 9) Which of the following variable declaration is incorrect? a. All of these b. _a=3 c. a?=3 d. a_=3 10) Strings in Python are _____ a. immutable b. None of these c. mutable d. fixed 11) If a is declared as a=[‘me’, ‘he’, ‘they’], the value of a=””.join(a) print(a) will be ______ . a. mehethey b. he they me c. None of these d. me he they 12) What will be the output of the following Python code? print("Hello {0} and {1}".format(('foo', 'bin'))) a. Hello foo and bin b. Hello (‘foo’, ‘bin’) and (‘foo’, ‘bin’) c. Error d. None of the mentioned 13) What will be the output of the following Python code? x = ['ab', 'cd'] for i in x: x.append(i.upper()) print(x) a. Infinite Loop b. v[‘AB’, ‘CD’] c. [‘ab’, ‘cd’, ‘AB’, ‘CD’] d. [‘ab’, ‘cd’] 14) Which term describes a loop that continues repeating without a terminating (ending) condition ? a. None of these b. unlimited loop c. conditional loop d. Infinite Loop 15) Suppose listExample is [‘h’,’e’,’l’,’l’,’o’], what is len(listExample)? a. 4 b. Error c. None d. 5 16) What will be the output of the following Python code? x = "abcdef" i = "a" while i in x: print('i', end = " ") a. no output b. a a a a a a … c. a b c d e f d. i i i i i i … 17) ______ are the modes of both writing and reading in binary format in file. a. None of these b. bw+ c. wb+ d. rb+ 18) What will be the output of the following Python code? a = [1, 5, 7, 9, 9, 1] <br class="blank" />b=a[0] <br class="blank" />x= 0 for x in range(1, len(a)): if a[x] > b: b = a[x] b= x print(b) a. 4 b. 0 c. 5 d. 3 19) Is Python case sensitive when dealing with identifiers? a. no b. none of the mentioned c. yes d. machine dependent 20) n the Python statement x =a + 5 – b : a + 5 – b is a. operators b. Operands c. Equation d. Expression 21) The offset of the local DST time zone. a. alt.Timezone b. Time.altzone c. None d. zone.altTime 22) Which function is used to converts and returns the binary equivalent string of a given integer. a. bin() b. int() c. binary() d. Zip() 23) Leading white space at the beginning of each statement, which is used to determine the group of statement. a. None of the above b. Testing c. Debugging d. Indentation 24) What will be the output of the following Python code? l=[1,2,3,4,5] [x&1 for x in l] a. [1, 0, 1, 0, 1] b. [0, 1, 0, 1, 0] c. [1, 1, 1, 1, 1] d. [1, 0, 0, 0, 0] 25) The write method returns ________. a. connector b. Algorithm c. Variables d. None 26) It defines the accessibility and the lifetime of a variable. a. keyword b. scope c. None d. Lifetime 27) Method is used to display entire contents of the file. a. read() b. readlines() c. Both d. None 28) By using function _____ ,we can change the shape of the Numpy array in python. a. None of these b. shape () c. reshape() d. change() 29) What will be the output of the following Python code? x = "abcdef" i = "a" while i in x[1:]: print(i, end = " ") a. no output b. a a a a a a c. a d. error 30) What will be the output of the following Python code? import math [str(round(math.pi)) for i in range (1, 6)] a. [‘3.1’, ‘3.14’, ‘3.142’, ‘3.1416’, ‘3.14159’, ‘3.141582’] b. [‘3’, ‘3’, ‘3’, ‘3’, ‘3’] c. [‘3’, ‘3’, ‘3’, ‘3’, ‘3’, ‘3’] d. [‘3.1’, ‘3.14’, ‘3.142’, ‘3.1416’, ‘3.14159’] 31) What will be the output of the following Python code snippet? k = [print(i) for i in my_string if i not in "aeiou"] a. prints all the vowels in my_string b. prints all characters of my_string that aren’t vowels c. prints only on executing print(k) d. prints all the consonants in my_string 32) What is the syntax of the following Python code? >>> a=frozenset(set([5,6,7])) >>> a a. {5,6,7} b. Syntax error c. frozenset({5,6,7}) d. Error, not possible to convert set into frozenset 33) is used for data analysis and manipulations in tabular data in Python. a. block b. Pandas c. rhombus d. circle 34) What will be the output of the following Python code? print('*', "abcdef".center(7), '*', sep='') a. * abcdef * b. *abcdef * c. * abcdef * d. * abcdef* 35) Which method is used to Write(s) a list of lines to the file. a. readlines (lines) b. write(s) c. None of these d. writelines (lines) 36) The process of finding errors in code is called as a. Debugging b. Running c. Testing d. Compiling 37) What will be the output of the following Python expression if x=56.236? print(“%.2f”%x) a. 56.23 b. 0056.236 c. 56.00 d. 56.24 38) Which mode Opens a file for both reading and writing in binary format. a. rb+ b. rb- c. Wb d. None 39) The ______ statement lets the program go through the piece of code without performing any action. a. Get b. None of these c. Range d. pass 40) What is the symbol used to represent start and stop of a flowchart? a. arrow b. rectangle c. diamond d. oval 41) What will be the output of the following Python code? print("xyyzxyzxzxyy".count('yy', 1)) a. 2 b. 0 c. 1 d. none of the mentioned 42) Flowchart and algorithms are used for a. easy testing and debugging b. Efficient Coding c. Better programming d. All 43) What will be the output of the following Python code? myList = [1, 2, 3, 4, 5, 6] for i in range(1, 6):   myList[i - 1] = myList[i]   for i in range(0, 6):   print(myList[i], end = " ") a. 2 3 4 5 6 1 b. 2 3 4 5 6 6 c. 1 1 2 3 4 5 d. 6 1 2 3 4 5 44) What will be the output of the following Python code? def f(values):   values[0] = 44   v = [1, 2, 3] f(v) print(v) a. [44, 2, 3] b. [1, 2, 3, 44] c. [1, 2, 3] d. [1, 44] 45) In which year was the Python language developed? a. 1995 b. 1972 c. 1989 d. 1981 46) 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 47) The expression _____ implies that the variable x is converted to integer. a. int (x) b. exp(x) c. None of these d. chr (x) 48) The Compexity of linear search algorithm is a. O(n) b. O(n2) c. O (log n) d. O (n log n) 49) Which translator is used to convert assembly language into machine language? a. None of these b. Compiler c. Assembler d. Interpreter 50) What will be the output of the following Python code snippet? print('Hello World'.istitle()) a. Error b. False c. True d. None 51) All parameters (arguments) in the Python language are passed by. a. reference b. Database c. Spreadsheet d. Text document 52) Which function is used to Writes the string(s) to the file and returns the number of characters written. a. writeline (s) b. None c. write(s) d. read(s) 53) It refers to the ability of an application to run on different platforms with or without minimal changes. a. Error b. Reliability c. Portability d. Flexibility 54) ……….design approach starts by dividing the complex algorithm into one or more modules. a. None of the above b. Both of the above c. Down-Top d. Top-Down 55) What will be the output of the following Python code? d = {0, 1, 2} for x in d.values(): print(x) a. 0 1 2 b. error c. None None None d. none of the mentioned 56) Which of the following is an invalid variable? a. 1st_string b. my_string_1 c. _myvar d. foo 57) What will be the output of the following Python code ? a = { 1 : “A”, 2 : “B”, 3 : “C” } for i in a: print (i, end=” “) a. None of these b. 'A' 'B' 'C' c. 1 'A' 2 'B' 3 'C' d. 1 2 3 58) Which one of the following has the same precedence level? a. Addition and Subtraction b. Addition and Multiplication c. Multiplication, Division, Addition and Subtraction d. Multiplication, Division and Addition 59) Which of the following data types is not supported in python? a. Slice b. Number c. List d. String 60) If we not see the rules of th programming language, we get ? a. Runtime Error b. None of the above c. Logical Error d. Syntax Error 61) What will be the output of the following Python code snippet? print('11'.isnumeric()) a. False b. None c. True d. Error 62) The operator used for concatenating two strings. – a. % b. + c. * d. None 63) ______ method parses the expression passed to it and runs python expression(code) within the program. a. a string b. Array c. The eval() d. fp.tell() 64) 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. s1.issuperset(s2) b. s2.issuperset(s1) c. s2.issubset(s1) d. s1.isset(s2) 65) Error does not fall into any category a. None of these b. Value Error c. Syntax Error d. Runtime Error 66) What will be the output of the following Python code? >>> a={3,4,5} >>> b={5,6,7} >>> a|b a. {3,4,6,7} b. Invalid operation c. {5} d. {3, 4, 5, 6, 7} 67) Is the following Python code valid? a={3,4,{7,5}} print(a[2][0]) a. Error, subsets aren’t allowed b. Yes, 7 is printed c. Yes, {7,5} is printed d. Error, elements of a set can’t be printed 68) Which of the following expressions results in an error? a. float(‘10’) b. int(‘10’) c. float(’10.8’) d. int(’10.8’) 69) 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. a is the smallest number b. stop c. cis the smallest number d. b is the smallest number 70) To use a module in another module, you must import it using an, statement a. both (A) and (B) b. include c. import d. none of the above 71) Which of the following statement is correct about Getcwd() . a. Method displays the directory of a process. b. Method displays the current working directory of a process c. Method create file of a process. d. None of these 72) Which of the following function of dictionary gets all the keys from the dictionary? a. getkeys () b. None c. keys() d. key() 73) _____is a Pandas function for loading CSV files into Dataframe. a. csv_read() b. csv.write() c. None of these d. read_csv() 74) What will be the output of the following Python code? >>>list("a#b#c#d".split('#')) a. [‘a#b#c#d’] b. [‘a’, ‘b’, ‘c’, ‘d’] c. [‘abcd’] d. [‘a b c d’] 75) Is the following Python code valid? >>> a=frozenset([5,6,7]) >>> a >>> a.add(5) a. Yes, now is a {5,5,6,7} b. No, frozen set is immutable c. No, invalid syntax for add method d. Yes, now a is {5,6,7} 76) What will be the output of the following Python code? >>> s={5,6} >>> s*3 a. Error as unsupported operand type for set data type b. Error as multiplication creates duplicate elements which isn’t allowed c. {5,6,5,6,5,6} d. {5,6} 77) The operator returns the quotent after division. a. // b. & c. % d. None of these 78) What is the value of the expression 10 + 3 ** 3 * 2? a. 829 b. 64 c. 739 d. 28 79) What will be the output of the following Python expression? 24//6%3, 24//4//2 a. (1,0) b. (0,3) c. (1,3) d. (3,1) 80) What will be the output of the following Python code? print("xyyzxyzxzxyy".count('xyy', -10, -1)) a. 2 b. 1 c. 0 d. error 81) What does the following code print ? if 2 + 5 == 8:   print("TRUE") else:   print("FALSE") print("TRUE") a. TRUE FALSE b. FALSE TRUE c. TRUE d. TRUE TRUE 82) What will be the output of following statement ? >>>"m"+"nl" a. 'm n1' b. 'm+nl' c. 'm' d. 'mn1' 83) What will be the output of the following Python code? x = 123 for i in x: print(i) a. none of the mentioned b. error c. 123 d. 1 2 3 84) Algorithms cannot be represented by____ a. syntax b. flowcharts c. pseudo codes d. programs 85) Identify the correct sequence of steps to run a program. a. Link, load, Code, Compile, & Execute b. Compile, Code, Link, load & Execute c. Code, Compile, Link, load & Execute d. Code, Compile, Link, Execute & load 86) ___ in Python is a counter-controlled loop. a. None of the above b. while c. for d. Both A and B 87) What will be the output of the following Python code? d = {0: 'a', 1: 'b', 2: 'c'} for i in d: print(i) a. 0 1 2 b. none of the mentioned c. a b c d. 0 a 1 b 2 c 88) Row data assigned to a variable is called as. a. variable b. literal c. identifier d. comment 89) What will be the output of the following Python code snippet? print('HelloWorld'.istitle()) a. None b. True c. Error d. False 90) Which method is used to Write(s) a list of lines to the file. a. None of these b. write(s) c. writelines (lines) d. readlines (lines) 91) Which symbol is used to write single line comment ? a. ? b. # c. . d. / 92) What will be the output of the following Python code snippet? print('1.1'.isnumeric()) a. Error b. False c. None d. True 93) In the declaration, x = Circle (), x contains a _to Circle object. - a. dropna() b. Reference c. None of these d. Optimisers 94) What will be the output of the following Python code? myList = [1, 5, 5, 5, 5, 1] max = myList[0] indexOfMax = 0 for i in range(1, len(myList)):   if myList[i] > max:     max = myList[i]     indexOfMax = i  print(indexOfMax) a. 1 b. 4 c. 2 d. 3 95) _______ help programmers to create lists in a concise way. a. piFun() b. List Comprehensions c. ndarray d. str() 96) Which character is used in Python to make a single line comment? a. ! b. / c. // d. # 97) What is testing process' first goal ? a. Bug prevention b. Analyses c. All of These d. Testing 98) Which of these is not a core data type ? a. Tuples b. Class c. Lists d. Dictionary 99) What will be the output of the following Python code? values = [[3, 4, 5, 1], [33, 6, 1, 2]] v = values[0][0] for row in range(0, len(values)):   for column in range(0, len(values[row])):     if v < values[row][column]:       v = values[row][column] print(v) a. 3 b. 5 c. 33 d. 6 100) Leading white space at the beginning of each element, which is used to determine the group of statement a. Testing b. Indentation c. Debugging d. None of the above Your score is