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 code snippet? a = 2.19 b=3.999999 C= -3.30 printint((a), floor(b), ceil(c), fabs(c)) a. 2 3-3 3.3 b. 23-33 c. 23-3 -3.3 d. 3 4 -33 2) ___ in Python is a counter-controlled loop. a. None of the above b. while c. Both A and B d. for 3) What will be the output of the following Python code? >>> a={1,2,3} >>> b=a.add(4) >>> b a. Nothing is printed b. None c. {1,2,3} d. {1,2,3,4} 4) What will be the output of the following Python code? print('ab,12'.isalnum()) a. None b. Error c. False d. True 5) What will be the output of the following Python code? >>>list("a#b#c#d".split('#')) a. [‘abcd’] b. [‘a b c d’] c. [‘a#b#c#d’] d. [‘a’, ‘b’, ‘c’, ‘d’] 6) A program that convert a high-level language program to a set of instructions that can run on a computer is called a a. None of the above b. Editor c. Compiler d. Debugger 7) The word comes from the name of a Persian mathematician Abu Ja’far Mohammed ibn-i Musa al Khowarizmi is called? a. Flowchart b. Syntax c. Flow d. Algorithm 8) Which of the following declaration is incorrect? a. _a=3 b. All of These c. a_=3 d. a?=3 9) Which of the following is an invalid statement in python. a. a,b,c=200,300,400 b. abc=200 300 400 c. abc=2,00,000 d. a_b_c= 2,00,000 10) Which of the following will run without errors? a. round() b. round(45.8) c. round(6352.898,2,5) d. round(7463.123,2,1) 11) In a Python program, a control structure: a. dictates what happens before the program starts and after it terminates b. In a Python program, a control structure: c. manages the input and output of control characters d. defines program-specific data structures 12) What will be the output of the following Python code? print("Hello {name1} and {name2}".format(name1='foo', name2='bin')) a. Error b. Hello and c. Hello foo and bin d. Hello {name1} and {name2} 13) Find the invalid variable among the following: a. infomax b. my_string_1 c. _mySring d. 1st_string 14) The data type whose representation is known are called a. Derived datatype b. Concrete datatype c. Built in datatype d. Abstract datatype 15) The correct extension of the Python file is a. py b. none of these c. python d. pyth 16) What will be the output of the following Python expression if x=456? print(“%-06d”%x) a. 456000 b. 456 c. 000456 d. error 17) The write method returns ________. a. None b. connector c. Variables d. Algorithm 18) The GCD of the numbers 136 and 170 is ______ . a. 34 b. 50 c. None d. 40 19) List structure in python where elements are stored in parenthesis. a. {} b. [] c. () d. none of these 20) What is testing process’ first goal ? a. Bug prevention b. Testing c. All of These d. Analyses 21) Suppose t=(1,2,4,3), which of the following is incorrect? a. t[3] = 45 b. print(max(t)) c. print(len(t)) d. print(t[3]) 22) What is the extension of Python code File? a. .py b. .ppt c. .pyt d. .python 23) The complexity of linear search algorithm is a. O(n) b. O(n log n) c. O(log n) d. O(n2) 24) What will be the output of the following Python code? >>> a={5,6,7,8} >>> b={7,8,9,10} >>> len(a+b) a. 8 b. Nothing is displayed c. Error, unsupported operand ‘+’ for sets d. 6 25) If we overcome the rules of the programming language, we get a. Runtime error b. None of the above. c. logical error d. Syntax error 26) 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() 27) which of the following is an escape sequence for a tab character a. t b. b c. n d. a 28) NumPY stands for. – a. Number In Python b. None of the above c. Numerical Python d. Numbering Python 29) A detailed flowchart is know as a. Micro b. Macro c. Stack d. Union 30) What will be the output of the following Python code? a= [1, 2, 3, 4, 5] for i in range(1, 5): a[i-1] = a[i] for i in range(0, 5): print(a[i],end = " ") a. 5 1 2 3 4 b. 5 5 1 2 3 c. 2 3 4 5 1 d. 2 3 4 5 5 31) The symbol used for conditional statement n a flow chart is a ____ a. Diamond box b. None of the above c. Circle shape d. rectangular box 32) What will be the output of the following Python code snippet? print('11'.isnumeric()) a. True b. Error c. None d. False 33) The operator returns the quotent after division. a. // b. & c. % d. None of these 34) To convert the read value through input() into integer type, ______ () is used a. floating b. integer c. int d. float 35) Diamond shaped symbol is used in flowcharts to show the a. Error box b. Statement box c. If-statement box d. Decision box 36) Python code can run on a variety of platforms, it means Python is a _____ language. a. All of these b. Graphical c. Platform Dependent d. Cross-Platform 37) If a={5,6,7,8}, which of the following statements is false? a. print(min(a)) b. print(len(a)) c. a[2]=45 d. a.remove(5) 38) 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. [18, 12, 6, 15, 10, 5, 12, 8, 4] b. [4, 8, 12, 5, 10, 15, 6, 12, 18] c. [4, 10, 18] d. [4, 5, 6, 8, 10, 12, 12, 15, 18] 39) What will be the output of the following Python code? d = {0, 1, 2} for x in d: print(d.add(x)) a. 0 1 2 b. None of the mentioned c. 0 1 2 0 1 2 0 1 2 … d. None None None 40) Suppose list1 is [1, 3, 2], What is list1 * 2? a. [2, 6, 4] b. [1, 3, 2, 1, 3] c. [1, 3, 2, 3, 2, 1] d. [1, 3, 2, 1, 3, 2] 41) 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. 24 b. 12 c. 30 d. 33 42) Which symbol is used to write single line comment ? a. / b. # c. ? d. . 43) What is the output of >>>float(‘12.6’) a. '12.6' b. 12 c. Syntax Error d. 12.6 44) ( What will be the output of the following Python code? >>> a={5,4} >>> b={1,2,4,5} >>> a<b a. False b. True c. {1,2} d. Invalid operation 45) Which of the following statement is false about recursion: a. Infinite recursion can occur if the base case isn't properly mentioned b. Every recursive function must have a return value c. A recursive function makes the code easier to understand d. Every recursive function must have a base case 46) If list1=[10,20,30], then operation list1*2 returns ____ . a. [10,20,30,10,20,30] b. [10,20,30,20,40,60] c. [20,40,60] d. None 47) What will be the output of the following Python code? a. 33% b. 0.33% c. 0.33 d. 33.33% 48) A detailed flowchart is known as: a. Micro b. Macro c. Stack d. Union 49) In Python, ________ is not supported. a. Tuple comprehension b. return values c. None d. Tuple assignment 50) What will be the output of the following Python code? x = ['ab', 'cd'] for i in x:   i.upper() print(x) a. [‘AB’, ‘CD’] b. [None, None] c. none of the mentioned d. [‘ab’, ‘cd’] 51) Which of the following software translates source code into object code ? a. Interpreter b. Compiler c. None d. Assembler 52) What will be the output of the following Python code snippet? a. The sum of 2 and 10 is 12 b. Error c. None of the mentioned d. The sum of 0 and 1 is 2 53) If a=(1,2,3,4), a[1:-1] is _________ a. [2,3] b. (2,3,4) c. Error, tuple slicing doesn’t exist d. (2,3) 54) Which of the following is not a relational opeartor in Python? a. = b. != c. >= d. <= 55) What will be the output of the following Python code? A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] [A[row][1] for row in (0, 1, 2)] a. [7, 8, 9] b. [1, 4, 7] c. [2, 5, 8] d. [4, 5, 6] 56) What is mean by dynamically typed language a. A variable can store any datatype type of value b. A variable can store only one type of value c. A value of a variable is change each type when it run d. A variable can store only numeric value 57) What will be the value of the following Python expression? float(4+int(2.39)%2) a. 4 b. 5 c. 5.0 d. 4.0 58) What will be the output of the following Python code snippet? not(10<20) and not(10>30) a. False b. True c. No output d. Error 59) When an algorithm is written in the form of a programming language, it becomes a : a. Program b. Syntax c. Flowchart d. Pseudo code 60) The graphical representation of algorithm is a. statement b. Algorithm c. Flowchart d. program 61) Is the following Python code valid? >>> a=(1,2,3,4) >>> del a a. Yes, first element in the tuple is deleted b. No because tuple is immutable c. Yes, the entire tuple is deleted d. No, invalid syntax for del method 62) Which one of the following is a valid Python if statement: a. if (a>= 2) b. if a> = 2: c. if a >= 22 d. if (a => 22) 63) What is the value of the expression 100 // 25 ? a. 4 b. 4.0 c. 2.5 d. None of These 64) What will be the result of the expression 15 and 10? a. 0 b. 1 c. 5 d. 10 65) 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. 'A' 'B' 'C' b. 1 'A' 2 'B' 3 'C' c. 1 2 3 d. None of these 66) _____ function convert an integer to octal string in python. a. None of the these b. unichr (x) c. chr(x) d. oct (x) 67) If we not see the rules of th programming language, we get ? a. Runtime Error b. Syntax Error c. Logical Error d. None of the above 68) What will be the output of the following Python code? print("abcdef".center(7, 1)) a. abcdef b. 1abcdef c. error d. abcdef1 69) Output data screen a. A flowchart b. A flowchart or pseudo code c. A decision d. tep by step instructions used to solve a problem 70) 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 … 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. 8 b. 7 c. 9 d. 6 72) What is the output of the following? m=0 while m<5:   m+=1   if m==3:     break   else: print(0) a. error b. 0 1 2 c. 0 0 1 0 2 d. 0 1 2 0 73) What will be the output of the following Python code? >>>example = "snow world" >>>example[3] = 's' >>>print example a. snow b. Error c. snos world d. snow world 74) Every function has an implicit statement _____ as the last instruction in the function body. a. Return b. pass c. for d. None of these 75) A function used for writing data in the binary format: a. dump b. send c. output d. write 76) The command is used to take input from the keyboard. a. Input b. Pass c. Open d. Range 77) The default separator character of print() is ___ a. newline b. space c. tab d. dot 78) Which of the following is a feature of DocString? a. All functions should have a docstring. b. Docstrings can be accessed by the ___doc_attribute on objects. c. Provide a convenient way of associating documentation with Python modules, functions, classes, and methods. d. All of the mentioned. 79) What will be the output of the following Python code snippet? print('for'.isidentifier()) a. None b. True c. False d. Error 80) The datatype whose representation is known are called a. concrete datatype b. Built in datatype c. Derived datatype d. Abstract datatype 81) Which of the following is the use of function in python ? a. you can't also create your own functions b. Functions don't provide better modularity for your application c. all of these d. Functions are reusable pieces of programs 82) What will be the output of the following Python code? print('ab'.isalpha()) a. Error b. None c. True d. False 83) What will be the output of the following Python code? s={1, 2, 3} s.update(4) s a. Error b. {4, 1, 2, 3} c. {1, 2, 4, 3} d. {1, 2, 3, 4} 84) What will be the output of the following Python code snippet? print('my_string'.isidentifier()) a. Error b. False c. None d. True 85) Which method is used to Write(s) a list of lines to the file. a. writelines (lines) b. write(s) c. None of these d. readlines (lines) 86) Testing is known as a. None of the above b. Evaluating deliverable to find errors c. Finding broken code d. A stage of all projects 87) How can we create on empty list in Python? a. list=() b. list.null c. null.list d. list=[] 88) The operator used to calculate remainder after division. a. b. None of these c. % d. / 89) Which of the following precedence order is correct in Python? a. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential b. Exponential,Parentheses,Multiplication, Division, Addition, Subtraction c. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential d. Parentheses, Exponential,Multiplication, Division, Addition, Subtraction 90) Is the following Python code valid? >>> a=2,3,4,5 >>> a a. No, too many values to unpack b. Yes, [2,3,4,5] is printed c. Yes, 2 is printed d. Yes, (2,3,4,5) is printed 91) 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 only on executing print(k) b. prints all characters of my_string that aren’t vowels c. prints all the vowels in my_string d. prints all the consonants in my_string 92) What is identity array? a. None of these b. This is a square array with ones on the main diagonal. c. This is a array with ones on the main diagonal. d. This is a normal array. 93) What is called when a function is defined inside a class? a. Method b. Another function c. Class d. Module 94) In computer science, refers to a special method usable by a computer for the solution to a problem. a. algorithm b. program c. None of these d. Graph 95) Which character is used in Python to make a single line comment? a. / b. // c. ! d. # 96) What will be the output of the following Python code? i = 0 while i < 3: print(i) i += 1 else: print(0) a. 0 1 2 0 b. error c. 0 1 2 d. 0 1 2 3 0 97) Which of the following is not true about an interpreter a. None of the above b. Interpreter is a kind of translator c. Interpreter generates an object program from the source program d. Interpreter analysis each source statement every time it is to be executed 98) In Python, a variable must be declared before it is assigned a value. a. True b. Only in Functions c. Only in modules d. False 99) What is the value of the expression 100 / 25 ? a. none of these b. 4.0 c. 2.5 d. 4 100) 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. s1.isset(s2) d. s2.issubset(s1) Your score is