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 following statement ? >>>"m"+"nl" a. 'm' b. 'mn1' c. 'm n1' d. 'm+nl' 2) The word comes from the name of a Persian mathematician Abu Ja’far Mohammed ibn-i Musa al Khowarizmi is called? a. Flowchart b. Flow c. Syntax d. Algorithm 3) What is identity array? a. None of these b. This is a normal array. c. This is a square array with ones on the main diagonal. d. This is a array with ones on the main diagonal. 4) 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 5) Which of the following refers to mathematical function ? import numpy as np ary = np.array([1,2,3,5,8]) ary = ary + 1 print (ary[1]) a. 2 b. None of these c. 3 d. 5 6) What will be the output of the following Python code? string = "my name is x" for i in string: print (i, end=", ") a. m, y, , n, a, m, e, , i, s, , x, b. m, y, , n, a, m, e, , i, s, , x c. my, name, is, x, d. error 7) What will be the output of the following Python code? def m(list): v = list[0] for e in list: if v < e: v = e return v values = [[3, 4, 5, 1], [33, 6, 1, 2]] for row in values: print(m(row), end = " ") a. 3 33 b. 1 1 c. 5 6 d. 5 33 8) What will be the output of the following Python code? list1 = [11, 2, 23] list2 = [11, 2, 2] a. Error b. False c. None d. True 9) Error does not fall into any category a. Syntax Error b. Value Error c. None of these d. Runtime Error 10) Set of statements is executed again and again based upon conditional test. a. Looping b. None c. Selective d. Sequence 11) What will be the output of the following Python code? a=[13,56,17] a.append([87]) a.extend([45,67]) print(a) a. [13, 56, 17, [87], 45, 67] b. [13, 56, 17, 87, 45, 67] c. [13, 56, 17, 87,[ 45, 67]] d. [13, 56, 17, [87], [45, 67]] 12) What will be the output of the following Python code? data = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] def ttt(m): v = m[0][0] for row in m: for element in row: if v < element: v = element return v print(ttt(data[0])) a. 4 b. 1 c. 2 d. 5 13) 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. 1 2 3 b. None of these c. 'A' 'B' 'C' d. 1 'A' 2 'B' 3 'C' 14) What will be the output of the following Python expression? 24//6%3, 24//4//2 a. (1,0) b. (3,1) c. (1,3) d. (0,3) 15) Connectors used to connect flowchart symbols to each other are classified as. a. Annotation b. Arrow lines. c. Symbols d. Special symbols 16) Select the reserve keyword in Python a. all of these b. import c. print d. else 17) What will be the output of the following Python code snippet? print([[i+j for i in "abc"] for j in "def"]) a. [‘ad’, ‘ae’, ‘af’, ‘bd’, ‘be’, ‘bf’, ‘cd’, ‘ce’, ‘cf’] b. What will be the output of the following Python code snippet? print([[i+j for i in "abc"] for j in "def"]) c. [[‘ad’, ‘bd’, ‘cd’], [‘ae’, ‘be’, ‘ce’], [‘af’, ‘bf’, ‘cf’]] d. [[‘da’, ‘db’, ‘dc’], [‘ea’, ‘eb’, ‘ec’], [‘fa’, ‘fb’, ‘fc’]] 18) What will be the output of the following Python code snippet? x = 2 for i in range(x): x -= 2 print (x) a. 0 1 2 3 4 … b. 0 -2 c. error d. 0 19) What will be the output of the following Python statement?(python 3.xx) >>>print(format("Welcome", "10s"), end = '#') >>>print(format(111, "4d"), end = '#') >>>print(format(924.656, "3.2f")) a. Welcome # 111#924.66 b. Welcome#111#.66 c. Welcome#111#924.66 d. Welcome# 111#924.66 20) A natural number 1 is also an ____ . a. None of these b. Factor c. unique number d. integer number 21) Is it safe to directly use the == operator to determine whether objects of type float are equal ? a. Yes, if the values are > 100 b. No c. Yes d. Yes, if the values are < 100 22) Algorithms cannot be represented by a. pseudo codes b. programs c. syntax d. flowcharts 23) What is the output of the following code? list1=[2, 33, 222, 14, 25] print(list1[ : -1 ]) a. [2, 33, 222, 14] b. Error c. [25, 14, 222, 33, 2] d. 25 24) Function range(3) will yield an iteratable sequence like a. [1, 2, 3] b. [0, 1, 2, 3] c. [0, 1, 2] d. [1, 2, 3] 25) What will be the output of the following Python code snippet? print('HelloWorld'.istitle()) a. Error b. False c. True d. None 26) 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. ABCD b. abcd c. error d. none of the mentioned 27) What will be the output of the following Python code? a. 33.33% b. 0.33 c. 33% d. 0.33% 28) Which of the following precedence order is correct in Python? a. Parentheses, Exponential,Multiplication, Division, Addition, Subtraction b. Exponential,Parentheses,Multiplication, Division, Addition, Subtraction c. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential d. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential 29) What will be the value of X in the following Python expression? X = 2+9*((3*12)-8)/10 a. 27.2 b. 30.0 c. 28.4 d. 30.8 30) Which of these in not a core data type? a. Tuples b. Class c. Dictionary d. Lists 31) Function range(0, 5, 2) will yield on iterable sequence like a. [0, 1, 2, 5] b. [0, 5, 2] c. [1, 3, 5] d. [0, 2, 4] 32) If a is declared as a=['me', 'he', 'they'], the value of a="".join(a) print(a) will be ______ . a. None of these b. me he they c. he they me d. mehethey 33) Which of the following is not a Python IDE a. Sublime Test b. Jupyter Notes c. Spyder d. IDLE 34) What is the output of print(k) in the following Python code snippet? k = [print(i) for i in my_string if i not in "aeiou"] print(k) a. a list of Nones b. list of Falses c. list of Trues d. all characters of my_string that aren’t vowels 35) In which datatype we can store True/False type values a. Float b. Boolean c. String d. Integer 36) What is the symbol used to represent start and stop of a flowchart ? a. Oval b. Rectangle c. Arrow d. Diamond 37) Which of the following will give error ? a. a, b, c = 1, "python", 1.5 b. a,b,c=1 c. None of the above d. a=b=c=1 38) Which of the following executes the programming code line by line? a. Interpreter b. Translator c. Compiler d. Executer 39) Which of the following is the basic I/O connections in file? a. Standard Input b. Standard Errors c. Standard Output d. All of the mentioned 40) Which of the following expressions is an example of type conversion? a. 4.0 + float(3) b. 5.3 + 6.3 c. 3 + 7 d. 5.0 + 3 41) What will be the output of the following Python code? print("xyyzxyzxzxyy".count('yy', 1)) a. none of the mentioned b. 2 c. 1 d. 0 42) What will be the output of the following Python expression if x=56.236? print("%.2f"%x) a. 56.23 b. 56.00 c. 0056.236 d. 56.24 43) What will be the output of the following pseudocode, where ^ represent XOR operation ? Integer a, b, c set b = 4, a = 3 c =a ^ b Print c a. 5 b. 3 c. 4 d. 7 44) The _____ statement is used for exiting from the loop. a. pass b. Break c. None of these d. Continue 45) Output data screen a. A decision b. A flowchart c. A flowchart or pseudo code d. tep by step instructions used to solve a problem 46) What will be the output of the following Python code? i = 2 while True: if i%3 == 0: break print(i) i += 2 a. 2 3 b. error c. 2 4 d. 2 4 6 8 10 … 47) The ________ function is used to convert a string value to int. a. eval b. open() c. int d. list 48) Users write the programs in which language? a. None of these b. Low-level Language c. Middle-level Language d. High-level Language 49) What will be the output of the following Python code snippet? {a**2 for a in range(4)} a. {0, 1, 4, 9} b. {1, 4, 9, 16} c. {0, 1, 4, 9, 16} d. Error 50) Every function has an implicit statement _____ as the last instruction in the function body. a. None of these b. pass c. Return d. for 51) Which of the following python function converts a string to a list. a. str() b. list() c. None of the above d. Both of the above 52) ____ help to check the data type of an array- a. arr.dtype() b. dtype.arr() c. arraydtype() d. None of these 53) Is the following Python code valid? >>> a=(1,2,3,4) >>> del a a. Yes, the entire tuple is deleted b. Yes, first element in the tuple is deleted c. No, invalid syntax for del method d. No because tuple is immutable 54) The process of finding errors in code is called as a. Running b. Compiling c. Testing d. Debugging 55) What will be the output of the following Python code? s=["pune", "mumbai", "delhi"] [(w.upper(), len(w)) for w in s] a. [‘PUNE’, 4, ‘MUMBAI’, 6, ‘DELHI’, 5] b. [(‘PUNE’, 4), (‘MUMBAI’, 6), (‘DELHI’, 5)] c. [PUNE, 4, MUMBAI, 6, DELHI, 5] d. Error 56) What is the output of >>>float('12.6') a. 12.6 b. syntax error c. 12 d. 12.6' 57) What will be the output of the following Python code snippet? x = [i**+1 for i in range(3)]; print(x); a. error, ‘;’ is not allowed b. [1, 2, 5] c. error, **+ is not a valid operator d. [0, 1, 2] 58) Row data assigned to a variable is called as. a. literal b. comment c. variable d. identifier 59) What will be the output of the following Python code snippet? a. Error b. None of the mentioned c. The sum of 0 and 1 is 2 d. The sum of 2 and 10 is 12 60) What will be the output of the following Python code snippet? my_string = "hello world" k = [(i.upper(), len(i)) for i in my_string] print(k) a. none of the mentioned b. [(‘HELLO WORLD’, 11)] c. [(‘HELLO’, 5), (‘WORLD’, 5)] d. [(‘H’, 1), (‘E’, 1), (‘L’, 1), (‘L’, 1), (‘O’, 1), (‘ ‘, 1), (‘W’, 1), (‘O’, 1), (‘R’, 1), (‘L’, 1), (‘D’, 1)] 61) ____ an explicit set of step by step specific instructions that solve a problem with an end or a solution a. None of these b. Algorithm c. Process d. Flowchart 62) Which of the following statements is used to create an empty set? a. ( ) b. [ ] c. { } d. set() 63) What will be the output of the following Python code? matrix = [[1, 2, 3, 4], [4, 5, 6, 7], [8, 9, 10, 11], [12, 13, 14, 15]] for i in range(0, 4): print(matrix[i][1], end = " ") a. 1 3 8 12 b. 1 2 3 4 c. 2 5 9 13 d. 4 5 6 7 64) The functions which are coming with Python software automatically are called ____ . a. None of these b. built-in functions c. built-in functions d. built-in functions 65) The ____ function is used to convert a string value to int. a. convert b. Str c. None of these d. int 66) What plays a vital role in Python programming? a. Control b. Indentation c. Statements d. Structure 67) What will be the output of the following Python code? a. a b c b. 0 a 1 b 2 c c. none of the mentioned d. 0 1 2 68) Which of these are keyword? a. All b. in c. is d. assert 69) What will be the output of the following Python code snippet? print('0xa'.isdigit()) a. False b. Error c. True d. None 70) Leading white space at the beginning of each statement, which is used to determine the group of statement. a. Testing b. Indentation c. None of the above d. Debugging 71) What will be the output of the following Python code? x = "abcdef" i = "a" while i in x[1:]: print(i, end = " ") a. error b. a a a a a a c. no output d. a 72) What will be the output of the following code snippet? a = 2.19 b=3.999999 C= -3.30 printint((a), floor(b), ceil(c), fabs(c)) a. 23-3 -3.3 b. 23-33 c. 3 4 -33 d. 2 3-3 3.3 73) Which of the following cannot be a variable ? a. _init_ b. in c. on d. it 74) Which method is used to Write(s) a list of lines to the file. a. readlines (lines) b. None of these c. writelines (lines) d. write(s) 75) In which language is Python written? a. English b. All of the above c. C d. PHP 76) 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. [1, 44] b. [1, 2, 3] c. [44, 2, 3] d. [1, 2, 3, 44] 77) Set of statements is executed based upon conditional test. a. Selective b. None c. Sequence d. Looping 78) Suppose i is 5 and j is 4, i + j is same as ________ a. i.__ADD(j) b. i.__add(j) c. i.__add__(j) d. i.__Add(j) 79) elif can be considered to be abbreviation of a. nested if b. if..else c. if..elif d. else if 80) Every function has an implicit statement _____ as the last instruction in the function body. a. for b. pass c. None of these d. Return 81) What will be the output of the following Python code snippet? print('a@ 1,'.islower()) a. True b. None c. False d. Error 82) Which of the following statement is correct about Getcwd() . a. Method displays the directory of a process. b. Method create file of a process. c. Method displays the current working directory of a process d. None of these 83) The scope rule in Python are summarized as____. a. LEGB (local, enclosed,global, built-in ) b. None of these c. Both of the above d. ELGB ( enclosed, local,global, built-in). 84) What will be the output of the following Python code? numberGames = {} numberGames[(1,2,4)] = 8 numberGames[(4,2,1)] = 10 numberGames[(1,2)] = 12 sum = 0 for k in numberGames: sum += numberGames[k] print len(numberGames) + sum a. 30 b. 12 c. 24 d. 33 85) Which one of the following is a valid Python if statement: a. if a >= 22 b. if (a>= 2) c. if a> = 2: d. if (a => 22) 86) What will be the output of the following Python code? print('Hello!2@#World'.istitle()) a. error b. None c. False d. True 87) Which Python built in function returns the unique number assigned to an object? a. identity( ) b. refnum( ) c. ref( ) d. id( ) 88) What will be the output of the following Python code? >>> a=(2,3,4) >>> sum(a,3) a. 9 b. Too many arguments for sum() method c. The method sum() doesn’t exist for tuples d. 12 89) Is the following Python code valid? a={3,4,{7,5}} print(a[2][0]) a. Error, elements of a set can’t be printed b. Error, subsets aren’t allowed c. Yes, {7,5} is printed d. Yes, 7 is printed 90) Python code can run on variety of plateforms, it means Python is a _____language. a. Graphical b. All of these c. Cross-plateform d. Plateform Dependen 91) The order of statement execution in the form of top to bottom, is known as .......... construct. a. flow b. selection c. sequence d. repetition 92) An algorithm that calls itself directly or indirectly is known as a. Traversal algorithm b. Sub algorithm c. Polish notation d. Recursion 93) The function that yields current position in the file a. Writelines() b. None of the above c. write() d. tell() 94) Correcting the program code: a. Debugging b. Runtime error c. Syntax error d. Testing 95) An algorithm is best describe as a. None of the above b. A branch of mathematics c. A step by step procedure for solving a problem d. A computer language 96) Function range(10, 5, -2) will yield an iterable sequence like a. [9, 7, 5] b. [10, 8, 6] c. [6, 8, 10] d. [5, 7, 9] 97) To print a line a text without ending it with a newline, ____ argument is used with print() a. newline b. next c. end d. sep 98) Which module is to be imported for using randint() function? a. rand b. random c. randrange d. randomrange 99) Which one of these is floor division? a. / b. None of the mentioned c. % d. // 100) Which is the correct operator for power(x,y)? a. None of the mentioned b. X^^y c. X^y d. X**y Your score is