Python Mock Test 01 This mock test is specially designed for you. There are 50 questions in this mock test, for which 45 minutes time has been given, here you will get the same questions which are often asked in the exam, so read the test comfortably. If you have any problem then please tell in comment box. Abhay Excel Computer-Your Own Family To start the mock test, enter your email id and your name and get ready to do better. Gmail Name 1. What is the output of the following code? 4+2**5//10 Deselect Answer 3 0 7 77 None 2. What will be the output of the following code snippet? example = ["Sunday", "Monday", "Tuesday", "Wednesday"]; print(example[-3:-1]) Deselect Answer ['Sunday', 'Monday'] ['Wednesday', 'Monday'] ['Monday', 'Tuesday'] ['Tuesday', 'Wednesday'] None 3. What is the output for − 'python ' [-3]? Deselect Answer 'h' 'o' Negative index error. 't' None 4. Which of the following character is used to give single-line comments in Python? Deselect Answer ! // /* # None 5. Algorithm when transalated into a programming language is called. Deselect Answer code Identifier Debugging Flowchart None 6. Python is a .………….object-oriented programming language. Deselect Answer General purpose Special purpose Medium level programming language All of the mentioned above None 7. What is the output in python language? Round(.4)-Round(-.5) Deselect Answer 9 0 1 2 None 8. Who developed Python Programming Language? Deselect Answer Niene Stom Guido van Rossum Rasmus Lerdorf Wick van Rossum None 9. The action performed by a -------structure must eventually cause the loop to terminate. Deselect Answer Case Sequence Process Repetition None 10. Is Python code compiled or interpreted? Deselect Answer Python code is only interpreted Python code is both compiled and interpreted Python code is only compiled Python code is neither compiled nor interpreted None 11. Which of the following is the correct extension of the Python file? Deselect Answer .p .py .python .pl None 12. What is the name of the operator ** in Python? Deselect Answer Modulus % Floor division // None of the these Exponentiation ** None 13. What is the order of precedence in python? Deselect Answer Exponential, Parentheses, Multiplication, Division, Addition, Subtraction Exponential, Parentheses, Division, Multiplication, Addition, Subtraction Parentheses, Exponential, Multiplication, Division, Subtraction, Addition Parentheses, Exponential, Multiplication, Division, Addition, Subtraction None 14. Actual instructions in flowcharts are represented in ----- Deselect Answer Boxes Line Arrows Circles None 15. Which mode creates a new line file if the file does not exist? Deselect Answer None of the these Both A & B Append mode Write mode None 16. What will be the output of the following Python code snippet if x=1? x<<2 Deselect Answer 1 8 2 4 None 17. What will be the output of the following code snippet? print(2**3+(5+6)**(1+1)) Deselect Answer 8 121 129 None of the above. None 18. What keyword would you use to add an alternative condition to an if statement? Deselect Answer elif else if else None of the above None 19. What is output in python? print(r"\nhi") Deselect Answer \nhi hi error new line and hi None 20. Which types of logical operators in Python? Deselect Answer AND All of the above OR NOT None 21. Which statement will move file pointer 10 bytes backward from current position? Deselect Answer None of above f.seek(-10,1) f.seek(10,0) f.seek(-10,0) None 22. Method which uses a list of well defined instructions to complete a task starting from a given initial state to end state is called as---------- Deselect Answer Program Flowchart Algorithm Both A and C None 23. - -------- is a connector showing the relationship between the representative shapes. Deselect Answer Box Process Line Arrow None 24. What will be the value of the following Python expression? 4+3%5 Deselect Answer 2 4 7 1 None 25. Which are the application areas of Python programming? Deselect Answer All of the above Artificial Intelligence and Machine Learning Game Development Web Development None 26. Which of the following is used to define a block of code in Python language? Deselect Answer Brackets Indentation Key All of the mentioned None 27. NumPy stands for Deselect Answer None of these Number in Python Numbering Python Numerical Python None 28. Python supports the creation of anonymous functions at runtime, using a construct called Deselect Answer lambda none of the mentioned anonymous pi None 29. Which of the following is true for variable names in Python? Deselect Answer none of the mentioned underscore and ampersand are the only two special characters allowed unlimited length all private members must have leading and trailing underscores None 30. A flowchart that outlines the main segment of a program. Deselect Answer Micro input/output Macro oval start/end Union processing rectangle Decision Queue None 31. What is Numeric Types of Data Types ? Deselect Answer Int- a=5 ,b=1234568 Float a=5.0 All of the above Complex a+bj None 32. Which of the following is true for variable names? Deselect Answer Limited length Ampersand can be used in its name Unlimited length None of the Above None 33. Designing the problem? Deselect Answer logical error Algorithm Testing Debugging None 34. Which of the following is the use of function in python? Deselect Answer Functions are reusable pieces of programs Functions do not provide better modularity for your application You cannot also create your own functions All of mentions None 35. In Python, which of the following functions is a built-in function? Deselect Answer None of these val ( ) print ( ) func_k ( ) None 36. What is the data type of following object? A = [5,’abc’,3,2,6] Deselect Answer Tuple List Dictionary Array None 37. All keywords in Python are in _________ Deselect Answer lower case None of the mentioned UPPER CASE Capitalized True ,False ,None None 38. Which statement will check if a is equal to b? Deselect Answer if a == b: if a == b if a === c: if a = b: None 39. Which of the following functions can help us to find the version of python that we are currently working on? Deselect Answer sys.version ( 0 ) sys.version sys.version ( 1 ) sys.version ( ) None 40. Which keyword is used for function in Python language? Deselect Answer Define Fun def Function None 41. The examination of changing values of variables is called stepping Deselect Answer False True Can’t s say May be None 42. list, tuple dictionary are which types of Data Types. Deselect Answer Binary Types Sequence Types None of the above Boolean Types None 43. ---------------------- scans the entire program and translates it as a whole into machine code. Deselect Answer Debugger Interpreter Compiler None of Above None 44. Which type of Programming does Python support? Deselect Answer structured programming all of the mentioned functional programming object-oriented programming None 45. What does pip stand for python? Deselect Answer Pip Installs Packages Preferred Installer Program Pip Installs Python All of the mentioned None 46. If a is a dictionary with some key-value pairs, what does a.popitem() do? Deselect Answer Removes an arbitrary element Removes all the key-value pairs Invalid method for dictionary Removes the key-value pair for the key given as an argument None 47. Flowcharts and algorithms are used for Deselect Answer All of the Above Efficient coding Easy testing and debugging Better programming None 48. Python is a case sensitive language when dealing with identifiers. Deselect Answer False True Sometimes Never None 49. Which is not a feature of Python language? Deselect Answer Portable High level language Interpreted language Case Insensitive None 50. Each module should also be divided into sub modules according software engineering to and programming style. Deselect Answer None of Mentioned Top down Method Coding Bottom up Method None 1 out of 50 Please fill in the comment box below.