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) A detailed flow chart is called as______? a. macro b. micro c. stack d. union 2) The symbol is used for conditional statement in a flowchart is: a. c b. b c. d d. a 3) _____ is also known as the alias array. a. array b. ndarray c. alias d. None of these 4) Which of the following statements is used to create an empty set? a. { } b. [ ] c. ( ) d. set() 5) ______ is a set of functions you want to include in your application. a. Convert b. Module c. Dictionary d. Continue 6) _____ function convert an integer to octal string in python. a. None of the these b. oct (x) c. unichr (x) d. chr(x) 7) What will be the output of the following Python statement? >>>print('new' 'line') a. Error b. newline c. Output equivalent to print ‘newline d. new line 8) The word comes from the name of a Persian mathematician Abu Ja’far Mohammed ibn-i Musa al Khowarizmi is called? a. Algorithm b. Syntax c. Flowchart d. Flow 9) The ________ function is used to convert a string value to int. a. int b. open() c. list d. eval 10) 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] 11) A natural number 1 is also an ____ . a. unique number b. Factor c. integer number d. None of these 12) ……….design approach starts by dividing the complex algorithm into one or more modules. a. Both of the above b. Down-Top c. Top-Down d. None of the above 13) 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, 10, 18] c. [4, 8, 12, 5, 10, 15, 6, 12, 18] d. [4, 5, 6, 8, 10, 12, 12, 15, 18] 14) What will be the output of the following Python code? >>> a={1,2,3} >>> b=frozenset([3,4,5]) >>> a-b a. Error as difference between a set and frozenset can’t be found out b. Error as unsupported operand type for set data type c. frozenset({1,2}) d. {1,2} 15) What will be the output of the following Python code? >>> a=(1,2,3,4) >>> del(a[2]) a. Now, a=(1,3,4) b. Now a=(3,4) c. Error as tuple is immutable d. Now, a=(1,2,4) 16) For two objects x and y, the expression x is y will yield True, if and only if a. len(x) == len(y) b. id(x) == id(y) c. all of these d. x == y 17) In the Python statement x = a + 5 – b : a and b are a. Equation b. Expression c. Operands d. operators 18) Which of the following Python statements will result in the output: 6? A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] a. A[2][1] b. A[1][2] c. A[2][3] d. A[3][2] 19) Identify the correct sequence of steps to run a program. a. Compile, Code, Link, load & Execute b. Link, load, Code, Compile, & Execute c. Code, Compile, Link, Execute & load d. Code, Compile, Link, load & Execute 20) Which of the following is correct in respect of advantages of functions ? a. None b. Reducing duplication of code c. Decomposing complex problems into simpler pieces d. both 21) What will be the output of the following Python code? >>> a=(2,3,4) >>> sum(a,3) a. 12 b. The method sum() doesn’t exist for tuples c. 9 d. Too many arguments for sum() method 22) An algorithm is best describe as a. A step by step procedure for solving a problem b. A branch of mathematics c. None of the above d. A computer language 23) If we overcome the rules of the programming language, we get a. logical error b. None of the above. c. Runtime error d. Syntax error 24) What will be the output of the following Python code? x = "abcdef" i = "i" while i in x: print(i, end=" ") a. no output b. a b c d e f c. abcdef d. i i i i i i … 25) What will be the output of the following Python code? d = {0, 1, 2} for x in d: print(d.add(x)) a. None None None b. 0 1 2 0 1 2 0 1 2 … c. 0 1 2 d. None of the mentioned 26) The correct extension of the Python file is a. py b. python c. none of these d. pyth 27) Which of the following is not a relational opeartor in Python? a. >= b. != c. <= d. = 28) Suppose list1 is [3, 5, 25, 1, 3], what is min(list1)? a. 3 b. 25 c. 1 d. 5 29) Which function is used to get the Data Type of any value? a. type() b. datatype() c. data_type() d. datatype() 30) What function do you use to read a string? a. eval(enter(“Enter a string”)) b. enter(“Enter a string”) c. input(“Enter a string”) d. eval(input(“Enter a string”)) 31) What is the output of the code print(7%2). a. None of the above b. 1 c. 3.5 d. 5.5 32) What is the output of the following program ? print 0.1+0.2==0.3 a. True b. Machine dependent c. Error d. False 33) What will be the output of the following Python code? x = (i for i in range(3)) for i in x: print(i) a. 0 1 2 b. 0 1 2 0 1 2 c. none of the mentioned d. error 34) Which one is the type of algorithm: a. Greedy b. Flowchart c. Pseudo d. Connector 35) Which type of Programming does Python support? a. Object-oriented programming b. Functional programming c. Structured programming d. All of the mentioned 36) What will be the output of the following Python expression if x=22.19? print(“%5.2f”%x) a. 22.19 b. 22.00000 c. 22.20 d. 22.1900 37) Connectors used to connect flowchart symbols to each other are classified as a. Annotation b. Symbols c. Arrow lines d. Special symbols 38) What will be the output of the following Python code snippet? print('\t'.isspace()) a. Error b. False c. None d. True 39) np.eye() is used for creating: a. Identity Matrix b. Upper triangle Matrix c. Lower Triangle Matrix d. None of these 40) What will be the output of the following Python code? print("abcdef".center()) a. cd b. abcdef c. error d. none of the mentioned 41) Write the list comprehension to pick out only negative integers from a given list ‘l’. a. [x<0 in l] b. [x for x in l if x<0] c. [x for x<0 in l] d. [x in l for x<0] 42) Python is a/an _________ language. a. High Level b. Procedural c. Difficult d. Low Level 43) n the Python statement x =a + 5 – b : a + 5 – b is a. Equation b. operators c. Expression d. Operands 44) Function range(10, 5, -2) will yield an iterable sequence like a. [9, 7, 5] b. [10, 8, 6] c. [5, 7, 9] d. [6, 8, 10] 45) Which of the following software is required to run the hardware? a. Task Manager b. Task Bar c. Device Driver d. Program Manager 46) What is identity array? a. This is a array with ones on the main diagonal. b. None of these c. This is a normal array. d. This is a square array with ones on the main diagonal. 47) What will be the output of the following expression a. 3 b. 14 c. 1 d. 2 48) Which term describes a loop that continues repeating without a terminating (ending) condition ? a. None of these b. Infinite Loop c. unlimited loop d. conditional loop 49) Which of the following operator in python evaluates to true if the variables on either side of the operator point to the same object and false otherwise? a. ** b. // c. not in d. is 50) Which of the following is not a keyword in Python a. assert b. eval c. nonlocal d. pass 51) Which of the following software translates source code into object code ? a. None b. Interpreter c. Assembler d. Compiler 52) Algorithm when transalated into a programming language is called a. Identifier b. code c. Flowchart d. Debugging 53) 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 a 1 b 2 c b. none of the mentioned c. a b c d. 0 1 2 54) 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. [[‘da’, ‘db’, ‘dc’], [‘ea’, ‘eb’, ‘ec’], [‘fa’, ‘fb’, ‘fc’]] c. [[‘ad’, ‘bd’, ‘cd’], [‘ae’, ‘be’, ‘ce’], [‘af’, ‘bf’, ‘cf’]] d. [‘da’, ‘ea’, ‘fa’, ‘db’, ‘eb’, ‘fb’, ‘dc’, ‘ec’, ‘fc’] 55) print(0xA + 0xB + 0xC): a. Error b. 0x22 c. 33 d. 0xA0xB0xC 56) Which function is used to Writes the string(s) to the file and returns the number of characters written. a. read(s) b. write(s) c. writeline (s) d. None 57) ____ an explicit set of step by step specific instructions that solve a problem with an end or a solution a. Process b. Flowchart c. Algorithm d. None of these 58) What will be the output of the following Python code? >>> a,b=6,7 >>> a,b=b,a >>> a,b a. Invalid syntax b. (7,6) c. Nothing is printed d. (6,7) 59) Which of the following refers to mathematical function? a. add b. Sub c. rhombus d. sqrt 60) Designing the problem in known as a. Testing b. Algorithm c. logical error d. Debugging 61) Is the following Python code valid? a={1,2,3} b={1,2,3,4} c=a.issuperset(b) print(c) a. True b. Error, no method called issuperset() exists c. Syntax error for issuperset() method d. False 62) _______ are the modes of both writing and reading in binary format in file. a. (/) b. str() c. ndarray d. wb+ 63) Each module should also be divided into sub modules according to software engineering and programming style. a. Coding b. Top down method c. None of the abov d. Bottom up method 64) Connectors used to connect flowchart symbols to each other are classified as. a. Annotation b. Special symbols c. Symbols d. Arrow lines. 65) What will be the output of the following Python code? a. 0.33% b. 33.33% c. 0.33 d. 33% 66) Suppose list1 is [3, 4, 5, 20, 5], what is list1.index(5)? a. 2 b. 1 c. 0 d. 4 67) The way for solving a problem step by step is know as a. Palnning b. Execution c. Design d. Algorithm 68) A natural number 1 is also an ______. a. Algorithms b. Flow lines c. integer number d. List Comprehensions 69) The contents inside the “for loop” are separated by? a. hyphen b. comma c. semicolon d. colon 70) 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. [(x**2) for x in range(1, 13)] d. [(2**x) for x in range(0, 13)] 71) What will be the output of the following Python code? >>> a={1,2,3} >>> a.intersection_update({2,3,4,5}) >>> a a. {1,4,5} b. {2,3} c. Error, duplicate item present in list d. Error, no method called intersection_update for set data type 72) What will be the output of the following Python expression if X=345? print(“%06d”%X) a. 000345 b. 000000345 c. 345000000 d. 345000 73) Which one of the following is not a python’s predefined data type? a. Class b. Dictionary c. List d. Tuple 74) _________immediately terminates the current loop iteration. a. continue b. None of These c. pass d. break 75) What is identity array? a. None of these b. This is a array with ones on the main diagonal. c. This is a normal array. d. This is a square array with ones on the main diagonal. 76) Which of the following functions converts a string to a float in python ? a. int(x [,base]) b. long(x [,base]) c. float(x) d. str(x) 77) Select the reserved keyword in python. a. else b. All of the mentioned c. import d. raise 78) An algorithm that calls itself directly or indirectly is known as a. Sub algorithm b. Traversal algorithm c. Polish notation d. Recursion 79) 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. Function overloading c. Both of the above. d. None of these 80) Which Python built in function returns the unique number assigned to an object? a. identity( ) b. ref( ) c. id( ) d. refnum( ) 81) What will be the output of the following Python code? print('*', "abcdef".center(7), '*') a. * abcdef* b. * abcdef * c. * abcdef * d. *abcdef * 82) What will be the output of the following Python code? A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] [A[i][len(A)-1-i] for i in range(len(A))] a. [2, 5, 8] b. [3, 5, 7] c. [4, 5, 6] d. [1, 5, 9] 83) _____ reads one entire line from the file. a. None of these b. read() c. readinglines() d. readline() 84) Which operator is also called as Conditional operator? a. Logical b. Assignment c. Relational d. Ternary 85) Which of the following precedence order is correct in Python? a. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential b. Parentheses, Exponential,Multiplication, Division, Addition, Subtraction c. Exponential,Parentheses,Multiplication, Division, Addition, Subtraction d. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential 86) What is the output of this expression, 3*1**3? a. 9 b. 1 c. 3 d. 27 87) In which year was the Python language developed? a. 1972 b. 1981 c. 1995 d. 1989 88) 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, if the values are > 100 d. Yes 89) Which one is not the attribute of a file? a. rename b. closed c. mode d. softspace 90) Leading white space at the beginning of each element, which is used to determine the group of statement a. Debugging b. Testing c. None of the above d. Indentation 91) ______ valid attribute of a file object (fp) ? a. fp.mode & fp.name b. fp.name & fp.mode c. fp.size d. fp.closed 92) What will be the output of the following Python code? >>>str1="helloworld" >>>str1[::-1] a. hello b. dlrowolleh c. helloworld d. world 93) Which of the following language is understood by computer ? a. Machine language b. None of the above c. High-level language d. Assembly language 94) Which of the following language is understood by computer? a. Assembly languag b. None of these c. . Machine language d. High-level language 95) Python programming language was create by ______. a. Ray temilson b. Tim Berner c. D. d. Guido van Rossum 96) Which of the following symbols is used to represent output in a flow chart? a. Circle b. Parallelogram c. Square d. Triangle 97) What is the syntax of the following Python code? >>> a=frozenset(set([5,6,7])) >>> a a. frozenset({5,6,7}) b. Syntax error c. Error, not possible to convert set into frozenset d. {5,6,7} 98) Select the reserved keyword in python a. All of the mentioned b. raise c. else d. import 99) The operator returns the quotent after division. a. // b. % c. & d. None of these 100) A sequence of instruction, in a computer language, to get the desired result is known as a. None of the above b. An algorithm c. A decision table d. A program Your score is