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) The ____ function takes two parameters, filename and mode. a. Pass b. Input c. Open() d. Range 2) Which translator is used to convert assembly language into machine language? a. None of these b. Assembler c. Interpreter d. Compiler 3) ndarray is also known as the ____ array. a. variable b. None of these c. Array d. alias 4) 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. [0, 1, 2] c. error, **+ is not a valid operator d. [1, 2, 5] 5) Suppose list1 = [0.5 * x for x in range(0, 4)], list1 is: a. [0.0, 0.5, 1.0, 1.5, 2.0] b. [0, 1, 2, 3] c. [0.0, 0.5, 1.0, 1.5] d. [0, 1, 2, 3, 4] 6) Which is Special type of literal in Python a. String b. None c. Complex Number d. Integer 7) In which datatype we can store True/False type values a. Float b. String c. Boolean d. Integer 8) 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. {‘a’, ‘b’, ‘c’, ‘p’, ‘q’, ‘san’} c. {‘abc’, ‘p’, ‘q’, ‘san’} d. {‘a’, ‘b’, ‘c’, [‘p’, ‘q’], ‘san} 9) The _____ function converts the specified value into a string. a. str() b. String() c. None of these d. int() 10) Which of the following variable declaration is incorrect? a. a?=3 b. a_=3 c. _a=3 d. All of these 11) What will be the output of the following Python code? print('*', "abcdef".center(7), '*') a. * abcdef* b. *abcdef * c. * abcdef * d. * abcdef * 12) Which of the following language is understood by computer ? a. Assembly language b. None of the above c. Machine language d. High-level language 13) A graphical representation of a computer program in relation to its sequence of functions____ . a. None of these b. flowchart c. Algorithm d. Both of the above 14) The Python prompt indicates that Interpreter is ready to accept instruction. a. >>> b. # c. <<< d. << 15) What will be the output of the following expression a. 2 b. 3 c. 1 d. 14 16) What will be the output of the following Python expression? 24//6%3, 24//4//2 a. (0,3) b. (1,3) c. (1,0) d. (3,1) 17) Which inbuilt function is used to takes an iterable object as input and makes them immutable. a. None of these b. input() c. frozenset() d. obj() 18) Output data screen a. tep by step instructions used to solve a problem b. A flowchart c. A decision d. A flowchart or pseudo code 19) What is the maximum possible length of an identifier? a. 32 b. 16 c. 32 d. None of These 20) Select the reserved keyword in python a. raise b. import c. All of the mentioned d. else 21) In flowchart, parallelogram is used to show a. Operation on data b. Output data screen c. General input symbol d. Online use of keyboard 22) Function range(3) will yield an iteratable sequence like a. [0, 1, 2] b. [1, 2, 3] c. [1, 2, 3] d. [0, 1, 2, 3] 23) 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. None of these c. Both of the above. d. Function overloading 24) Which of the following expressions results in an error? a. float(’10.8’) b. float(‘10’) c. int(’10.8’) d. int(‘10’) 25) in python a variable named ‘num’ ,which type of value we can store in this variable a. Integer b. Float c. String d. All of These 26) What will be the output of the following Python code? print("abc DEF".capitalize()) a. ABC DEF b. Abc Def c. abc def d. Abc def 27) What will be the value of the following Python expression? float(4+int(2.39)%2) a. 5 b. 4 c. 5.0 d. 4.0 28) Which of the following data types is not supported in python a. Numbers b. String c. List d. Slice 29) What will be the output of the following Python code? print("ccdcddcd".find("c")) a. Error b. 4 c. True d. 0 30) The part of a machine level instruction, which tells the central processor what has to be done, is a. An address b. None of the above c. An operand d. An operation code 31) Which of the following expressions is an example of type conversion? a. 5.0 + 3 b. 4.0 + float(3) c. 3 + 7 d. 5.3 + 6.3 32) What will be the output of the following Python code? print("xyyzxyzxzxyy".endswith("xyy", 0, 2)) a. False b. True c. 1 d. 0 33) Which one of the following is the correct extension of the Python file- a. .py b. .p c. None of these d. .python 34) Is the following Python code valid? >>> a=(1,2,3) >>> b=a.update(4,) a. No because wrong syntax for update() method b. No because tuples are immutable c. Yes, a=(1,2,3) and b=(1,2,3,4) d. Yes, a=(1,2,3,4) and b=(1,2,3,4) 35) All keywords in python are in ____ a. UPPERCASE b. Capitalized c. lowercase d. None of the mentioned 36) Which function is used to converts and returns the binary equivalent string of a given integer. a. binary() b. bin() c. int() d. Zip() 37) 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 7 b. error c. 1 2 3 4 5 6 d. none of the mentioned 38) Which is/are the valid statement to print Hello Word in Python ? a. print('Hello Word') b. Both A and B c. print("Hello Word") d. print(Hello Word) 39) If a={5,6,7}, what happens when a.add(5) is executed? a. a={5,6,7} b. Error as 5 already exists in the set c. a={5,5,6,7} d. Error as there is no add function for set data type 40) What will be the output of the following Python code? a = [5,5,6,7,7,7] b = set(a) def test(lst): if lst in b: return 1 else: return 0 for i in filter(test, a): print(i,end=” “) a. 5 6 7 b. 5 5 6 c. 5 6 7 7 7 d. 5 5 6 7 7 7 41) What is the value of the expression 100 / 25 ? a. 4.0 b. none of these c. 4 d. 2.5 42) Which of these is not a core data type ? a. Tuples b. Class c. Lists d. Dictionary 43) Which among the following list of operators has the highest precedence? +, -, **, %, /, <<, >>, | a. << b. % c. ** d. | 44) 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. local variables b. Global variables c. datatype d. None of these 45) The method used to removes all the items at once. a. remove () b. removelist () c. None of these d. clear() 46) Method is used to display entire contents of the file. a. readlines() b. Both c. None d. read() 47) Kite/diamond symbol in flow chart is used for_______ a. Statement b. All of the above c. Decision d. Execution 48) What will be the output of the following Python code? def power(x, y=2): r=1 for i in range(y): r=r*x return r print(power(3)) print(power(3,3)) (A) 212 32 (B) 9 27 (C) 567 98 (D) None of the above a. (A) b. (C) c. (B) d. (D) 49) 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 50) What will be the result of the expression 15 and 10? a. 0 b. 5 c. 10 d. 1 51) What will be the output of the following Python code? >>>example = "helle" >>>example.find("e") a. 0 b. 1 c. Error d. -1 52) A sequence of instruction, in a computer language, to get the desired result is known as _____ . a. A decision table b. A program c. An Algorithm d. None of the above 53) What will be the output of the following Python statement? >>>"abcd"[2:] a. cd b. ab c. dc d. a 54) Which of the following is not a legal integer type value in python. a. Decimal b. Hexadecimal c. Octal d. Roman 55) Which of the following Python statements will result in the output: 6? A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] a. A[3][2] b. A[1][2] c. A[2][3] d. A[2][1] 56) Function range(10, 5, 2) will yield an iterable sequence like a. [2, 5, 8] b. [10, 8, 6] c. [] d. [8, 5, 2] 57) ______ method parses the expression passed to it and runs python expression(code) within the program. a. The eval() b. Array c. fp.tell() d. a string 58) Which of the following is correct to Identify the right way to close a file. a. Close(file) b. File.close() c. File.close d. None 59) Who developed Python ? a. Bill Gates b. Ritche c. Sunder Pitchai d. Guido Van Rossum 60) What will be the output of the following Python code? >>> a={4,5,6} >>> b={2,8,6} >>> a-b a. Error as unsupported operand type for set data type b. Error as the duplicate item 6 is present in both sets c. {6} d. {4,5} 61) It refers to the ability of an application to run on different plateforms with or without minimal changes. a. Reliability b. Error c. Flexibility d. Portability 62) What is range() Funciton ? a. Arranging numbers whether in ascending or descending order. b. immediate exit from the innermost loop structure. c. returned an iterator a sequence object. d. generates a list of numbers, to iterate over with for loops 63) What is called when a function is defined inside a class? a. Class b. Module c. Method d. Another function 64) What will be the output of the following Python code snippet? x = 'abcd' for i in range(len(x)): x[i].upper() print (x) a. error b. none of the mentioned c. ABCD d. abcd 65) Which of the following is a floor division operator? a. // b. % c. || d. / 66) The write method returns ________. a. Variables b. connector c. Algorithm d. None 67) To add a new element to a list we use which command? a. list1.addEnd(5) b. list1.add(5) c. list1.append(5) d. list1.addLast(5) 68) What will be the output of the following pseudo code ? Integer a Set a =4 do print a + 2 a = a-1 while (a not equals 0) end while a. 6 6 6 6 b. 6 8 10 12 c. 6 5 4 3 d. 6 7 8 9 69) When _____ gets executed, ‘inner PI value’ is printed as that is ‘pi’ value inside the function namespace. a. Fun() b. piFun() c. pi() d. None of these 70) What is unpickling ? a. None of the above. b. Both of the above c. It is used for object serialization. d. It is used for object deserialization. 71) What will be the output of the following Python code? print("abcdef".find("cd")) a. 2 b. True c. 3 d. None of the mentioned 72) ______ are the modes of both writing and reading in binary format in file. a. bw+ b. None of these c. rb+ d. wb+ 73) Suppose list1 is [1, 5, 9], what is sum(list1)? a. 9 b. 1 c. Error d. 15 74) Which of the following is not an immutable type in Python ? a. String b. Tuples c. None of these d. Set 75) In order to store values in terms of key and value we use what core data type. a. class b. tuple c. list d. dictionary 76) To retrieve the character at index 3 from string s=”Hello” what command do we execute (multiple answers allowed)? a. s.getItem(3) b. s.__getitem__(3) c. s[] d. s.getitem(3) 77) are set of procedures defined in library to find the minimum value function or the root of an equation. a. Pandas b. scipy () c. Optimisers d. None of these 78) Which of the following statement is false about recursion: a. A recursive function makes the code easier to understand b. Every recursive function must have a return value c. Infinite recursion can occur if the base case isn't properly mentioned d. Every recursive function must have a base case 79) The following symbol represent a. Initialization b. None of Mentioned c. Input/Output d. Decision 80) Algorithms cannot be represented by____ a. flowcharts b. programs c. syntax d. pseudo codes 81) A function used for writing data in the binary format: a. send b. output c. write d. dump 82) What will be the output of the following Python code? x = (i for i in range(3)) for i in x: print(i) for i in x: print(i) a. none of the mentioned b. 0 1 2 0 1 2 c. error d. 0 1 2 83) Which of the following executes the programming code line by line? a. Compiler b. Translator c. Interpreter d. Executer 84) Suppose t=(1,2,4,3), which of the following is incorrect? a. t[3] = 45 b. print(len(t)) c. print(t[3]) d. print(max(t)) 85) What will be the output of the following Python statement? >>>chr(ord('A')) a. a b. A c. Error d. B 86) What will be the output of the following Python code snippet? print('\t'.isspace()) a. Error b. True c. False d. None 87) What will be the output of the following Python code? list1 = [11, 2, 23] list2 = [11, 2, 2] a. None b. Error c. False d. True 88) The program must be able to handle unexpected situation like wrong input or no input. a. Error b. Portability c. Reliability d. Expression 89) What will be the output of the following Python code? >>>max("what are you") a. u b. error c. t d. y 90) By using function _____ ,we can change the shape of the Numpy array in python. a. shape () b. reshape() c. None of these d. change() 91) Can we write if / else into one line in python? a. None of the above. b. if / else not used in python c. No d. Yes 92) A natural number 1 is also an ____ . a. Factor b. unique number c. None of these d. integer number 93) What will be the output of the following Python code? x = 'abcd' for i in range(len(x)): print(i.upper()) a. a b c d b. 1 2 3 4 c. error d. 0 1 2 3 94) What is testing process’ first goal ? a. Bug prevention b. Analyses c. All of These d. Testing 95) Which operator is also called as Comparative operator? a. Assignment b. Logical c. Relational d. Arithmetic 96) What is the extension of Python code File? a. .ppt b. .py c. .pyt d. .python 97) What will be the output of the following expression ? x =4 print(x<<2) a. 6 b. 2 c. 4 d. 16 98) Which of the following is not a legal integer type value in Python a. Decimal b. Roman c. Octal d. Hexadecimal 99) A loop block in python starts with a.. - a. ; (semicolon) b. : (colan) c. ,(Comma) d. None of these 100) Which of the following functions converts a string to a float in python ? a. float(x) b. long(x [,base]) c. int(x [,base]) d. str(x) Your score is