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? x = "abcdef" while i in x: print(i, end=" ") a. error b. abcdef c. a b c d e f d. i i i i i i … 2) Array processing package. a. Array b. None of these c. Numpy d. dictionary 3) _____ returns the current time instant, a floating-point number of seconds since the epoch. a. None of the above b. Time.time() c. datetime() d. time.date() 4) When _____ gets executed, ‘inner PI value’ is printed as that is ‘pi’ value inside the function namespace. a. piFun() b. Fun() c. pi() d. None of these 5) What is the extension of Python code File? a. .py b. .pyt c. .ppt d. .python 6) Which of the following is an invalid statement? a. a,b,c = 1000, 2000, 3000 b. abc = 1,000,000 c. a_b_c = 1,000,000 d. a b c = 1000 2000 3000 7) ____ statement used for error checking. – a. List b. Assert c. Tuple d. None of these 8) By using function _____ ,we can change the shape of the Numpy array in python. a. change() b. reshape() c. None of these d. shape () 9) Which statement is correct about Isalnum(). a. Method returns False if all characters in the string are alphanumeric numbers(either alphabets numbers). If not,it returns Tru b. Both of the above c. Method returns true if all characters in the string are alphanumeric numbers(either alphabets numbers). If not,it returns false d. None of these 10) The function generates sequence of numbers from 1 to n. a. Open b. Pass c. Range d. Input 11) What will be the output of the following Python code? i = 1 while True: if i%3 == 0: break print(i) i + = 1 a. 1 2 b. none of the mentioned c. error d. 1 2 3 12) Which of the following is a floor division operator? a. / b. || c. % d. // 13) Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.reverse()? a. [3, 4, 5, 20, 5, 25, 1, 3] b. [25, 20, 5, 5, 4, 3, 3, 1] c. [3, 1, 25, 5, 20, 5, 4, 3] d. [1, 3, 3, 4, 5, 5, 20, 25] 14) 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. list of Trues b. a list of Nones c. all characters of my_string that aren’t vowels d. list of Falses 15) What will be the output of the following Python code? print("xyyzxyzxzxyy".count('yy', 1)) a. none of the mentioned b. 2 c. 0 d. 1 16) The default separator character of print() is ___ a. space b. tab c. dot d. newline 17) What will be the output of the following Python code? >>>t = (1, 2) >>>2 * t a. (1, 2, 1, 2) b. [1, 2, 1, 2] c. (1, 1, 2, 2) d. [1, 1, 2, 2] 18) What is the output of the following program ? print 0.1+0.2==0.3 a. False b. Error c. Machine dependent d. True 19) 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) 20) ndarray is also known as the ____ array. a. variable b. alias c. Array d. None of these 21) Which operator is also called as Conditional operator? a. Relational b. Ternary c. Assignment d. Logical 22) Which of these in not a core data type? a. Class b. Tuples c. Lists d. Dictionary 23) What will be the output of the following Python code? d = {0, 1, 2} for x in d.values(): print(x) a. 0 1 2 b. none of the mentioned c. error d. None None None 24) Python converts the source code into an intermediate form called ____ . a. bytecode b. human-readable code c. None of these d. Source-code 25) The ______ mode of Python gives instant result of typed statement a. All of these b. Combination of Interactive and Script modes c. Script Mode d. Interactive Mode 26) Algorithms cannot be represented by____ a. programs b. pseudo codes c. syntax d. flowcharts 27) _____ reports all error with line numbers and produce faster object code then interpreter. a. None of these b. Translator c. Compiler d. Assembler 28) _______ help programmers to create lists in a concise way. a. List Comprehensions b. piFun() c. str() d. ndarray 29) What will be the output of the following Python code? print('a B'.isalpha()) a. None b. Error c. False d. True 30) Which of the following python function converts a string to a list. a. str() b. None of the above c. Both of the above d. list() 31) Python operator always yields the result of a. all of these b. floating point c. complex d. integer 32) Which of these about a frozenset is not true? a. Immutable data type b. Data type with unordered values c. Allows duplicate values d. Mutable data type 33) In which year was the Python 3.0 version developed? a. 2005 b. 2010 c. 2000 d. 2008 34) The order of statement execution in the form of top to bottom, is known as ………. construct. a. selection b. flow c. repetition d. sequence 35) What will be the output of the following Python code? print('ab12'.isalnum()) a. None b. True c. False d. Error 36) What will be the output of the following Python code? print('*', "abcdef".center(7), '*', sep='') a. * abcdef * b. *abcdef * c. * abcdef * d. * abcdef* 37) 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. 3 c. 4 d. 0 38) Is the following Python code valid? >>> a=2,3,4,5 >>> a a. Yes, [2,3,4,5] is printed b. Yes, 2 is printed c. No, too many values to unpack d. Yes, (2,3,4,5) is printed 39) What is the answer to this expression, 22 % 3 is? a. 7 b. 0 c. 1 d. 5 40) Function range(3) will yield an iteratable sequence like a. [1, 2, 3] b. [1, 2, 3] c. [0, 1, 2, 3] d. [0, 1, 2] 41) The graphical representation of algorithm is a. program b. Algorithm c. statement d. Flowchart 42) What will be the output of the following Python code? print("abcdef".center()) a. cd b. abcdef c. none of the mentioned d. error 43) An empty/null statement in Python is a. go b. ; c. pass d. over 44) In Python, ________ is not supported. a. None b. return values c. Tuple comprehension d. Tuple assignment 45) What will be the output of the following Python code? True = False while True: print(True) break a. False b. True c. None d. none of the mentioned 46) Which of the following expressions is an example of type conversion? a. 5.3 + 6.3 b. 5.0 + 3 c. 4.0 + float(3) d. 3 + 7 47) Designing the problem in known as a. Testing b. Algorithm c. Debugging d. logical error 48) The _____ function converts the specified value into a string. a. None of these b. int() c. str() d. String() 49) _______ is latest high level language. a. Delphi b. LISP c. MATLAB d. Ruby 50) Python code can run on a variety of platforms, it means Python is a _____ language. a. Platform Dependent b. All of these c. Graphical d. Cross-Platform 51) Which of the following is correct in respect of advantages of functions ? a. both b. None c. Reducing duplication of code d. Decomposing complex problems into simpler pieces 52) What will be the output of the following Python code? print("Hello {name1} and {name2}".format('foo', 'bin')) a. Hello {name1} and {name2} b. Error c. Hello and d. Hello foo and bin 53) What will be the output of the following Python code? import math [str(round(math.pi)) for i in range (1, 6)] a. [‘3’, ‘3’, ‘3’, ‘3’, ‘3’] b. [‘3.1’, ‘3.14’, ‘3.142’, ‘3.1416’, ‘3.14159’, ‘3.141582’] c. [‘3.1’, ‘3.14’, ‘3.142’, ‘3.1416’, ‘3.14159’] d. [‘3’, ‘3’, ‘3’, ‘3’, ‘3’, ‘3’] 54) 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] 55) 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 all the consonants in my_string b. prints all the vowels in my_string c. prints all characters of my_string that aren’t vowels d. prints only on executing print(k) 56) Which of the following expression is correct. a. All of the mentioned b. 10-(5**5)=-5 c. 21%4=1 d. -7*(10/2)=-35 57) 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. 58) The symbol used for both input and output is a _____ . a. parallelogram b. None of the above c. Circle shape d. Diamond shape 59) Connectors used to connect flowchart symbols to each other are classified as a. Special symbols b. Annotation c. Symbols d. Arrow lines 60) Which of the following is the use of function in python ? a. 20 b. 21 c. None d. 22 61) The following symbol represent a. None of Mentioned b. Decision c. Initialization d. Input/Output 62) Which one of the following has the highest precedence in the expression? a. Multiplication b. Exponential c. Parentheses d. Addition 63) By using function _____ ,we can change the shape of the Numpy array in python. a. shape () b. reshape() c. change() d. None of these 64) What will be the output of the following Python code? print("Hello {} and {}".format('foo', 'bin')) a. Hello foo and bin b. Error c. Hello {} and {} d. Hello and 65) What will be the output of the following Python code? i = 1 while True: if i%2 == 0: break print(i) i += 2 a. 1 2 3 4 5 6 … b. 1 c. 1 2 d. 1 3 5 7 9 11 … 66) Which of the following data types is not supported in python a. String b. Slice c. Numbers d. List 67) What will be the output of the following Python code snippet? not(10<20) and not(10>30) a. True b. No output c. False d. Error 68) What will be the output of the following Python code snippet? x = [i**+1 for i in range(3)]; print(x); a. [1, 2, 5] b. [0, 1, 2] c. error, **+ is not a valid operator d. error, ‘;’ is not allowed 69) A detailed flow chart is called as______? a. union b. macro c. stack d. micro 70) What will be the output of the following Python code? for i in range(5): if i == 5: break else: print(i) else: print("Here") a. 0 1 2 3 4 b. 1 2 3 4 5 c. 0 1 2 3 4 5 Here d. 0 1 2 3 4 Here 71) Python converts the source code into an intermediate form called ____ . a. bytecode b. human-readable code c. Source-code d. None of these 72) What will be the output of the following Python expression if X=345? print(“%06d”%X) a. 345000000 b. 000000345 c. 000345 d. 345000 73) elif can be considered to be abbreviation of a. nested if b. if..else c. if..elif d. else if 74) 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. none of the mentioned b. ABCD c. abcd d. error 75) Which of the statements about modules is false? a. When a module is loaded, a compiled version of the module with file extension .pyc is automatically produced. b. dir() built-in function monitors the items in the namespace of the main module. c. In the "from-import" form of import, all identifiers regardless of whether they are private or public are imported. d. In the “from-import" form of import, identifiers beginning with two underscores are private and aren't imported. 76) The write method returns ________. a. Variables b. Algorithm c. None d. connector 77) The _____ function converts the specified value into a string. a. String() b. str() c. int() d. None of these 78) 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 79) Is the following Python code valid? >>> a=(1,2,3) >>> b=('A','B','C') >>> c=zip(a,b) a. Yes, c will be ((1,2,3),(‘A’,’B’,’C’)) b. No because the syntax for zip function isn’t valid c. No because tuples are immutable d. Yes, c will be ((1,2,3),(‘A’,’B’,’C’)) 80) How can we create on empty list in Python? a. list=() b. null.list c. list=[] d. list.null 81) Testing is known as a. A stage of all projects b. None of the above c. Finding broken code d. Evaluating deliverable to find errors 82) What will be the output of the following Python statement? >>>chr(ord('A')) a. a b. B c. A d. Error 83) 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, 2, 3, 44] b. [44, 2, 3] c. [1, 44] d. [1, 2, 3] 84) What will be the output of the following Python code? d = {"john":40, "peter":45} d["john"] a. 45 b. “john” c. “peter” d. 40 85) 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, 101) if int(i*0.5)=(i*0.5)] c. [i for i in range(1, 100) if int(i*0.5)=(i*0.5)] d. [i for i in range(1, 100) if int(i*0.5)==(i*0.5)] 86) The output of this code is ______ . a. FALSE b. TrueFalse c. True d. 0 87) What will be the output of the following Python code? 87) What will be the output of the following Python code? >>>t=(1,2,4,3) >>>t[1:3] a. (1, 2, 4) b. (2, 4, 3) c. (1, 2) d. (2, 4) 88) What will be the output of the following Python code? a. 0.33% b. 0.33 c. 33.33% d. 33% 89) The functions which are coming with Python software automatically are called ____ . a. built-in functions b. User-defined functions c. Both of the above d. None of these 90) What will be the output of the following Python code? x = 'abcd' for i in range(x): print(i) a. a b c d b. 0 1 2 3 c. none of the mentioned d. error 91) What will be the output of the following Python expression if x=456? print(“%-06d”%x) a. 000456 b. 456000 c. 456 d. error 92) Python supports the creation of anonymous functions at runtime, using a construct called a. lambda b. anonymous c. none of the above d. pi 93) What will be the output of the following Python code? print("xyyzxyzxzxyy".count('xyy', 2, 11)) a. 0 b. error c. 1 d. 2 94) What will be the output of the following Python code? def unpack(a,b,c,d): print(a+d) x = [1,2,3,4] unpack(*x) a. [5] b. 5 c. Error d. [1,4] 95) What will be the output of the following ? a = 12.6 b = 2 print a//b a. None b. 6.3 c. 7 d. 6.0 96) 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 97) Python programming language was create by ______. a. Ray temilson b. D. c. Guido van Rossum d. Tim Berner 98) What will be the output of the following algorithm for a=5, b-8, c=6 ? Step 1: Start Step 2: Declare variables a, b and c. Step 3 Read variables a, b and c. Step 4: If a < b If a a. a is the smallest number b. cis the smallest number c. stop d. b is the smallest number 99) Which of the following language is understood by computer ? a. Machine language b. Assembly language c. High-level language d. None of the above 100) ______ in the flowchart is made at the connecting point marked. a. Continue b. Entry Connector c. main module d. Array Your score is