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? >>>str1="helloworld" >>>str1[::-1] a. helloworld b. hello c. world d. dlrowolleh 2) What will be the value of p when p= int(17/2+11.5)? a. 28 b. 20 c. 20.0 d. 28.0 3) What will be the output of the following Python code? print('Hello!2@#World'.istitle()) a. True b. None c. error d. False 4) 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’, ‘b’, ‘c’, [‘p’, ‘q’], ‘san} b. {‘a’, ‘b’, ‘c’, ‘p’, ‘q’, ‘san’} c. {‘abc’, ‘p’, ‘q’, ‘san’} d. {‘a’, ‘c’, ‘c’, ‘p’, ‘q’, ‘s’, ‘a’, ‘n’} 5) What will be the output of the following Python code? for i in range(int(float('inf'))): print (i) a. none of the mentioned b. 0.0 1.0 2.0 3.0 … c. 0 1 2 3 … d. 0.0 0.1 0.2 0.3 … 6) Python converts the source code into an intermediate form called ____ . a. bytecode b. None of these c. human-readable code d. Source-code 7) Which of the following is an invalid statement in python. a. abc=2,00,000 b. abc=200 300 400 c. a_b_c= 2,00,000 d. a,b,c=200,300,400 8) Each module should also be divided into sub modules according to software engineering and programming style. a. None of the abov b. Bottom up method c. Top down method d. Coding 9) Write a list comprehension equivalent for the Python code shown below. for i in range(1, 101): if int(i*0.5)==i*0.5: print(i) a. [i for i in range(1, 101) if int(i*0.5)==(i*0.5)] b. [i for i in range(1, 100) if int(i*0.5)==(i*0.5)] c. [i for i in range(1, 101) if int(i*0.5)=(i*0.5)] d. [i for i in range(1, 100) if int(i*0.5)=(i*0.5)] 10) What will be the output of the following Python code? values = [[3, 4, 5, 1], [33, 6, 1, 2]] v = values[0][0] for lst in values: for element in lst: if v > element: v = element print(v) a. 3 b. 1 c. 6 d. 5 11) What will be the output of the following Python code snippet? a. 3 4 b. 0 1 c. 0 1 2 3 4 … d. 0 1 2 3 12) Suppose list1 is [1, 3, 2], What is list1 * 2? a. [1, 3, 2, 3, 2, 1] b. [1, 3, 2, 1, 3, 2] c. [1, 3, 2, 1, 3] d. [2, 6, 4] 13) To print the value of a variable, Python uses a. print() Function b. print Statement c. Print Function() d. Print Statement 14) Can we write if / else into one line in python? a. Yes b. if / else not used in python c. No d. None of the above. 15) 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. 5 b. 0 c. 4 d. 3 16) Which of the following character is used to give comments in Python Program ? a. $ b. @ c. & d. # 17) What will be the output of the following Python code? x = "abcdef" i = "a" while i in x: x = x[:-1] print(i, end = " ") a. a a a a a b. a a a a a a c. none of the mentioned d. i i i i i i 18) What will be the output of the following Python code? x = "abcdef" i = "a" while i in x: print('i', end = " ") a. a a a a a a … b. a b c d e f c. i i i i i i … d. no output 19) What will be the output of the following Python code snippet? for i in [1, 2, 3, 4][::-1]: print (i) a. error b. 1 2 3 4 c. 4 3 2 1 d. none of the mentioned 20) Which of the following is an invalid variable? a. _myvar b. 1st_string c. foo d. my_string_1 21) Tool ________ is used for program design. a. Flowchart b. All of the above c. Algorithm d. Psuedocode 22) What is the output of the following code? a=set('abc') b=set('cdef') print(a&b) a. {'c'} b. {c} c. {'a','b','c','d','e','r'} d. None of these 23) Connectors used to connect flowchart symbols to each other are classified as. a. Symbols b. Special symbols c. Arrow lines. d. Annotation 24) Set makes use of __________ Dictionary makes use of ____________ a. keys, keys b. key values, key values c. key values, keys d. keys, key values 25) What will be the output of the following Python code? True = False while True: print(True) break a. none of the mentioned b. True c. None d. False 26) ______ in the flowchart is made at the connecting point marked. a. Entry Connector b. Continue c. main module d. Array 27) What will be the output of the following Python code? >>> a={4,5,6} >>> b={2,8,6} >>> a+b a. {4,5,6,2,8} b. Error as unsupported operand type for sets c. Error as the duplicate item 6 is present in both sets d. {4,5,6,2,8} 28) Which of the following statement(s) will terminate the whole loop and proceed to the statement following the loop ? a. pass b. continue c. break d. goto 29) When ______ gets executed, ‘inner PI value’ is printed as that is ‘pi’ value inside the function namespace. a. bytecode b. piFun() c. str() d. Flow lines 30) What will be the output of the “hello” +1+2+3? a. hello6 b. Error c. hello d. hello123 31) What is the output when we execute list(“hello”)? a. [‘olleh’] b. [‘h’, ‘e’, ‘l’, ‘l’, ‘o’] c. [‘hello’] d. [‘llo’] 32) It refers to the ability of an application to run on different platforms with or without minimal changes. a. Flexibility b. Error c. Reliability d. Portability 33) The datatype whose representation is unknown are called a. Built in datatype b. Derived datatype c. concrete datatype d. Abstract datatype 34) Which of the following software is required to run the hardware? a. Program Manager b. Task Bar c. Task Manager d. Device Driver 35) What will be the output of the following Python code? print('{a}{b}{a}'.format(a='hello', b='world')) a. ‘hello’ ‘world’ ‘hello’ b. ‘helloworldhello’ c. ‘hello’ ‘hello’ ‘world’ d. ‘hello world’ 36) What will be the output of the following Python code? >>>t1 = (1, 2, 4, 3) >>>t2 = (1, 2, 3, 4) >>>t1 < t2 a. False b. True c. Error d. None 37) Numpy was developed by___ . a. Guido van Rosum b. Travis Oliphant c. Wes McKinney d. Jim Hugunin 38) What will be the output of the following Python code? for i in range(float('inf')): print (i) a. 0.0 1.0 2.0 3.0 … b. 0.0 0.1 0.2 0.3 … c. none of the mentioned d. 0 1 2 3 … 39) Function range(10, 5, 2) will yield an iterable sequence like a. [8, 5, 2] b. [10, 8, 6] c. [2, 5, 8] d. [] 40) In python language, which of the following operators is the correct option for raising k to the power 1? a. k^1 b. k^ ^1 c. k**1 d. k^*1 41) What will be the output of the following Python code? print("Hello {} and {}".format('foo', 'bin')) a. Hello {} and {} b. Hello and c. Error d. Hello foo and bin 42) What will be the output of the following Python code? >>> a={1,2,3} >>> a.intersection_update({2,3,4,5}) >>> a a. Error, no method called intersection_update for set data type b. Error, duplicate item present in list c. {1,4,5} d. {2,3} 43) Negative count from the Right. a. L1[-2] b. None of the above c. L1[2] d. L1[-1] 44) What will be the output of the following Python code? i = 1 while False: if i%2 == 0: break print(i) i += 2 a. 1 2 3 4 … b. none of the mentioned c. 1 d. 1 3 5 7 … 45) What will be the output of the following Python code? A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] A[1] a. [1, 2, 3] b. [4, 5, 6] c. [3, 6, 9] d. [1, 4, 7] 46) 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. None of these d. Method displays the current working directory of a process 47) 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 7 7 b. 5 6 7 c. 5 5 6 7 7 7 d. 5 5 6 48) The readlines() method reads and returns ______ . a. Write individual lines b. A list of remaining lines of the entire file c. individual lines of a file. d. D. 49) Escape sequences are treated as ____ a. Characters b. Strings c. None of These d. Integers 50) 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. (D) b. (A) c. (B) d. (C) 51) Designing the problem in known as a. logical error b. Testing c. Algorithm d. Debugging 52) Which of the following will give error ? a. None of the above b. a, b, c = 1, "python", 1.5 c. a,b,c=1 d. a=b=c=1 53) What will be the output of the following Python code? d = {0: 'a', 1: 'b', 2: 'c'} for x in d.values(): print(d[x]) a. 0 1 2 b. a b c c. 0 a 1 b 2 c d. none of the mentioned 54) Which of the following function convert a sequence of tuples to dictionary in python? a. dict(d) b. set (x) c. chr(x) d. frozenset(s) 55) A step by step method for solving a problem using English Language a. Algorithm b. program c. Flowchart d. statement 56) _______ help programmers to create lists in a concise way. a. ndarray b. piFun() c. str() d. List Comprehensions 57) In which year was the Python 3.0 version developed? a. 2005 b. 2000 c. 2008 d. 2010 58) Python code can run on variety of plateforms, it means Python is a _____language. a. Cross-plateform b. Graphical c. Plateform Dependen d. All of these 59) An algorithm that calls itself directly or indirectly is known as a. Traversal algorithm b. Polish notation c. Recursion d. Sub algorithm 60) Two main measures for the efficiency of an algorithm are a. Processor and memory b. Time and space c. Complexity and capacity d. Data and space 61) Which of the following is an escape sequence for a new line character a. b b. a c. t d. n 62) Which of the following is not a keyword ? a. assert b. nonlocal c. eval d. finally 63) Every function has an implicit statement _____ as the last instruction in the function body. a. Return b. None of these c. pass d. for 64) What is the syntax of the following Python code? >>> a=frozenset(set([5,6,7])) >>> a a. Error, not possible to convert set into frozenset b. frozenset({5,6,7}) c. Syntax error d. {5,6,7} 65) What will be the output of the following Python code? print("Hello {0} and {1}".format('foo', 'bin')) a. Error b. Hello {0} and {1} foo bin c. Hello foo and bin d. Hello 0 and 1 66) The GCD of the numbers 136 and 170 is ______ . a. 40 b. 50 c. None d. 34 67) What will be the output of the following Python code? example = "helle" print(example.rfind("e")) a. 1 b. -1 c. 3 d. 4 68) Empty list indicated by which symbol. a. {} b. () c. [] d. None 69) What will be the output of the following Python code ? a. 1 2 b. 1 2 3 4 c. error d. None 70) What will be the output of the following Python code? x = 'abcd' for i in range(len(x)): print(i) a. a b c d b. 0 1 2 3 c. 1 2 3 4 d. error 71) Is the following Python code valid? a={1,2,3} b={1,2,3,4} c=a.issuperset(b) print(c) a. False b. Syntax error for issuperset() method c. True d. Error, no method called issuperset() exists 72) What will be the output of the following Python code? >>>example = "helle" >>>example.find("e") a. Error b. 0 c. -1 d. 1 73) What is the value of the expression 10 + 3 ** 3 * 2? a. 28 b. 829 c. 64 d. 739 74) Which of the following statement prints helloexample test.txt? a. print(“hello”example”test.txt”) b. print(“hello”example”est.txt”) c. print(“helloexample est.txt”) d. print(“helloexample test.txt”) 75) Which of the following words is not a keyword of python language? a. val b. with c. raise d. try 76) 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. 5 b. 4 c. 1 d. 2 77) What is the maximum possible length of an identifier for better redability? - a. 31 characters b. 63 characters c. All of the above. d. No limit but 79 characters for better redability 78) What is use of seek() method in files? a. sets the file's current position at the offset. b. sets the file's previous position at the offset. c. sets the file's current position within the file. d. None of the above 79) will return the mathematical number PI from the constants module. a. Circle() b. None of these c. Pandas d. Math.Pi 80) _______ is latest high level language. a. Delphi b. MATLAB c. LISP d. Ruby 81) Which of the following is not a legal integer type value in python. a. Octal b. Hexadecimal c. Decimal d. Roman 82) Select the reserved keyword in python. a. import b. else c. All of the mentioned d. raise 83) Every function has an implicit statement _____ as the last instruction in the function body. a. Return b. None of these c. for d. pass 84) What will be the output of the following Python code? [ord(ch) for ch in 'abc'] a. Error b. [65, 66, 67] c. [97, 98, 99] d. [‘97’, ‘98’, ‘99’] 85) Istrip() method is used for : a. delete all the trailing characters b. delete upper case characters c. delete all the leading and trailing characters d. delete all the leading characters 86) What will be the output of the following Python code snippet? for i in '': print (i) a. (nothing is printed) b. none of the mentioned c. None d. error 87) What will be the output of the following Python code snippet? print('my_string'.isidentifier()) a. None b. False c. True d. Error 88) Select the reserve keyword in Python a. all of these b. else c. import d. print 89) Which of the following is not valid Python identifiers? a. ca$h b. marks10 c. Python2Shar d. email 90) Flowchart and algorithms are used for a. Better programming b. Efficient Coding c. easy testing and debugging d. All 91) What will be the output of the following Python code? word1="Apple" word2="Apple" list1=[1,2,3] list2=[1,2,3] print(word1 is word2) print(list1 is list2) a. False True b. True False c. False False d. True True 92) Which of the following statement(s) will terminate only the current pass of the loop and proceed with the next iteration of the loop? a. pass b. continue c. goto d. break 93) What will be the result of the expression 5 and 10? a. 10 b. 5 c. 0 d. 1 94) Which of the following refers to mathematical function? a. sqrt b. Sub c. rhombus d. add 95) What will be the output of the following Python code? list1 = [1, 3] list2 = list1 list1[0] = 4 print(list2) a. [1, 3, 4] b. [1, 3] c. [1, 4] d. [4, 3] 96) What will be the output after the following statements? a = 0 b = 3 while a + b < 8: a += 1 print(a, end='') a. None of these b. 1 2 3 4 5 c. 1 2 3 4 5 6 d. 0 1 2 3 4 97) What will be the output of the following Python code? print("Hello {0} and {1}".format(('foo', 'bin'))) a. Error b. Hello (‘foo’, ‘bin’) and (‘foo’, ‘bin’) c. Hello foo and bin d. None of the mentioned 98) Testing is known as a. Finding broken code b. None of the above c. Evaluating deliverable to find errors d. A stage of all projects 99) 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. none of the mentioned b. ABCD c. error d. abcd 100) Find the invalid variable among the following: a. infomax b. 1st_string c. _mySring d. my_string_1 Your score is