This quiz works best with JavaScript enabled. Home > Cbse > Class 12 > Science > Computer Science > Class 12 Computer Science Chapter 2 Advanced Python Programming – Quiz 3 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 2 Advanced Python Programming Quiz 3 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. IN WHICH YEAR WAS THE PYTHON 3.0 VERSION DEVELOPED? A) 2008. B) 2000. C) 2005. D) 2010. Show Answer Correct Answer: A) 2008. 2. Which has integer data type? A) Zip code. B) Phone number. C) Number of students in the class. D) HN. Show Answer Correct Answer: C) Number of students in the class. 3. Essential thing to create a window screen using tkinter python is ..... A) Create a button. B) To define a geometry. C) Create a file. D) Call tk() function. Show Answer Correct Answer: D) Call tk() function. 4. Which method can be used to return a string in upper case letters? A) Uppercase(). B) ToUpperCase(). C) Upper(). D) UpperCase(). Show Answer Correct Answer: C) Upper(). 5. What is NIC used for? A) To remotely access PC. B) To connect computer to a network. C) It is used in junipers routers for gateway card. D) None. Show Answer Correct Answer: B) To connect computer to a network. 6. What data type is the object below? D = [1, 23, 'hello', 1] A) List. B) Dictionary. C) Tuple. D) Array. Show Answer Correct Answer: A) List. 7. The use of the mainloop() in Python Tkinter is ..... A) To exit window screen. B) To Hold the window Screen. C) To create a window screen. D) To Destroy the window screen. Show Answer Correct Answer: B) To Hold the window Screen. 8. Which of the following is not an IDE for Python? A) Thonny. B) Pycharm. C) Visual Studio Code. D) XML. Show Answer Correct Answer: D) XML. 9. Name some common data types in Python. A) Array. B) Integer. C) Integer, float, string, list, tuple, dictionary, boolean. D) Char. E) Float. Show Answer Correct Answer: C) Integer, float, string, list, tuple, dictionary, boolean. 10. What will be the output of the following code? my ..... string = "Python"print(my ..... string[0]) A) Error. B) P. C) T. D) Y. Show Answer Correct Answer: B) P. 11. Given a statement "All swan are white" . To falsify this statement, you need to travel around the world and find at least one non-white swan. Which one is a indispensable command in your coding? A) For loop. B) While loop. C) Conditional statement. D) None of the above. Show Answer Correct Answer: B) While loop. 12. What is the output of the following code:print 9//2 A) 4.0. B) 4. C) 4.5. D) Error. Show Answer Correct Answer: B) 4. 13. The correct way to use the config() function in tkinter is ..... A) Config(object, property). B) Config(property). C) Object.config(property). D) Object.property. Show Answer Correct Answer: C) Object.config(property). 14. What is the output:for i in range(2, , 2):print(i) A) Error. B) 2 4 6 8, 10 Even numbes prited. C) Infinite times i value incremented by setep 2. D) Blank Output. Show Answer Correct Answer: A) Error. 15. What is Python really? A) Visual basic. B) Python is an interpreted language. C) A snake. D) A form of font for writing. Show Answer Correct Answer: B) Python is an interpreted language. 16. Guess the Outputs={1, 2, 3, 5, 6, 7, 87, 8, 8}print(s[2:7]) A) {5, 6, 7, 87, 8}. B) Error. C) {2, 3, 5, 6, 7}. D) {5, 6, 7, 87, 8, 8}. Show Answer Correct Answer: B) Error. 17. Which of these collections defines a LIST? A) {"apple", "banana", "cherry"}. B) {"name": "apple", "color": "green"}. C) ("apple", "banana", "cherry"). D) ["apple", "banana", "cherry"]. Show Answer Correct Answer: D) ["apple", "banana", "cherry"]. 18. What does encapsulation help with in Object-Oriented Programming? A) Providing a unified interface to interact with different types of objects. B) Hiding the internal state of the object. C) Creating a blueprint for objects. D) Inheriting attributes from another class. Show Answer Correct Answer: B) Hiding the internal state of the object. 19. Given a Pandas series called Marks, the command which will display the first 3 rows is . A) Print(Marks.heads(3). B) Print(Marks.head(3)). C) Print(Marks.Heads(3)). D) Print(Marks.Head(3)). Show Answer Correct Answer: B) Print(Marks.head(3)). 20. What is the file extension for Python scripts? A) .java. B) .txt. C) .py. D) .html. Show Answer Correct Answer: C) .py. 21. Predict the outpout z=[1, 2, 3, 4, 5]print(2*z) A) Error. B) [2, 4, 6, 8, 10]. C) [2, 4, 6, 8, 10, 2, 4, 6, 8, 10]. D) [1, 2, 3, 4, 5, 1, 2, 3, 4, 5]. Show Answer Correct Answer: D) [1, 2, 3, 4, 5, 1, 2, 3, 4, 5]. 22. Which of the following is the correct statement?z = {"x":0, "y":1} A) Dictionary z is created. B) X and y are the keys of dictionary z. C) 0 and 1 are the values of dictionary z. D) All of the above. Show Answer Correct Answer: D) All of the above. 23. What is the correct syntax to return the fourth element in a list named 'fruits'? A) Fruits[4]. B) Fruits.get(4). C) Return fruits(4). D) Return fruits[3]. Show Answer Correct Answer: D) Return fruits[3]. 24. Which of the following is an example of string slicing in Python? A) "hello"[0]. B) "hello"[1:4]. C) "hello"[-1]. D) "hello"*3. Show Answer Correct Answer: B) "hello"[1:4]. 25. The method(s) to import a tkinter in python program is/are ..... A) Import tkinter. B) Import tkinter as t. C) From tkinter import *. D) All the above. Show Answer Correct Answer: D) All the above. 26. Predict the output:s="SRGEC"v=" for i in s:v=v+iprint(v) A) CEGRS. B) Error. C) Blank output. D) SRGEC. Show Answer Correct Answer: D) SRGEC. 27. What is the main purpose of Python? A) To design websites. B) To create hardware. C) To develop software and applications. D) To manage databases only. Show Answer Correct Answer: C) To develop software and applications. 28. Find the output of the following program segments:for i in range(20, 30, 2):print(i) A) 2022242628. B) 202224262830. C) 20 22 24 26 28 30. D) 20 22 24 26 28. Show Answer Correct Answer: A) 2022242628. 29. What is the full form of SQL A) Structured Query List. B) Structured Query Linking. C) Structured Quick Language. D) Structured Query Language. Show Answer Correct Answer: D) Structured Query Language. 30. Explain the concept of a dictionary in Python. A) A dictionary in Python is a collection of key-value pairs. It is unordered, changeable, and does not allow duplicate keys. Each key is unique and is used to access its corresponding value. B) A dictionary in Python is a collection of key-value pairs, but the keys can be duplicated. C) A dictionary in Python is a collection of values without keys. D) A dictionary in Python is a collection of ordered pairs. Show Answer Correct Answer: A) A dictionary in Python is a collection of key-value pairs. It is unordered, changeable, and does not allow duplicate keys. Each key is unique and is used to access its corresponding value. 31. What does indentation in Python indicate? A) A comment. B) A function. C) A block of code. D) A variable. Show Answer Correct Answer: C) A block of code. 32. What is the data type of print(type(10)) A) String. B) Integer. C) Int. D) Float. Show Answer Correct Answer: C) Int. 33. What is the scope of a variable in Python? A) Inner. B) Outer. C) Local, Enclosing, Global, and Built-in. D) Nested. Show Answer Correct Answer: C) Local, Enclosing, Global, and Built-in. 34. WHICH ONE OF THE FOLLOWING IS NOT SHOWN IN THE SYNTAX ERROR? A) Incorrect punctuation. B) Undefined terms. C) Low memory. D) None of the above. Show Answer Correct Answer: C) Low memory. 35. What is the output of the given below program?print("Know Program" .split()) A) {'Know', 'Program'}. B) 'Know', 'Program'. C) ('Know', 'Program'). D) ['Know', 'Program']. Show Answer Correct Answer: D) ['Know', 'Program']. 36. . In a type of computer network, what does MAN stands for? A) Metropolitan area network. B) Metropolis area network. C) Micro area network. D) Mini area network. Show Answer Correct Answer: A) Metropolitan area network. 37. Explain the concept of 'recursion' in Python functions. A) Recursion in Python functions always leads to infinite loops. B) Recursion in Python functions involves using loops instead of function calls. C) Recursion in Python functions can only be used for simple problems. D) Recursion in Python functions involves a function calling itself directly or indirectly to solve complex problems by breaking them down into smaller, simpler problems. Show Answer Correct Answer: D) Recursion in Python functions involves a function calling itself directly or indirectly to solve complex problems by breaking them down into smaller, simpler problems. 38. What is the output of len('Hello World')? A) 10. B) 11. C) 15. D) 12. Show Answer Correct Answer: B) 11. 39. What are the different data types in Python? A) The different data types in Python are:int, float, complex, str, list, tuple, set, dict, bool, and NoneType. B) Integer, decimal, character, list, boolean. C) Number, text, array, dictionary, boolean. D) Int, float, string, array, boolean. Show Answer Correct Answer: A) The different data types in Python are:int, float, complex, str, list, tuple, set, dict, bool, and NoneType. 40. How can you import a specific function from a module in Python? A) Using the 'import' keyword followed by the function name. B) Using the 'require' keyword followed by the function name. C) Using the 'import' keyword followed by the module name and function name separated by a dot. D) Using the 'use' keyword followed by the module name and function name separated by a dot. Show Answer Correct Answer: C) Using the 'import' keyword followed by the module name and function name separated by a dot. 41. ..... is a procedure or step by step process for solving a problem. A) Algorithm. B) Flowchart. C) Pseudocode. D) All of these. Show Answer Correct Answer: A) Algorithm. 42. Series = pd.series({'jan':31, "feb':29, 'march':31})print(series) gives? A) Jan 31feb 29march 31. B) 0 311 292 31. C) 0 jan 1 feb 2 march. D) None of the above. Show Answer Correct Answer: A) Jan 31feb 29march 31. 43. WHICH ONE OF THESE IS USED TO TAKE INPUT FROM THE USERS? A) Input. B) Print. C) System. D) None of the above. Show Answer Correct Answer: A) Input. 44. What will be the output?a = 25b = 4print (a%b) A) 6.2. B) 1. C) 1.5. D) 6. Show Answer Correct Answer: B) 1. 45. Which of these tests whether the variable x is the same as 'Hello'? A) X = "Hello". B) X != "Hello". C) X <> "Hello". D) X == "Hello". Show Answer Correct Answer: D) X == "Hello". 46. Which of the following is true about the input() function in Python? A) It is used to display output to the console. B) It pauses the program and waits for the user to type something and press Enter. C) It is used to compile the code. D) It is used to create a graphical user interface. Show Answer Correct Answer: B) It pauses the program and waits for the user to type something and press Enter. 47. What will be the output? name = 'Python' print (type(name)) A) 'Python'. B) Str. C) Error. D) Char. Show Answer Correct Answer: B) Str. 48. Which mathematical concept is fit to text data (e.g. words in documents) A) Tuple. B) Bag. C) Set. D) List. Show Answer Correct Answer: B) Bag. 49. How does the grid() function put the widget on the screen? A) According to x, y coordinate. B) According to left, right, up, down. C) According to horizontal, vertical. D) According to row and column wise. Show Answer Correct Answer: D) According to row and column wise. 50. Why are comments important in programming? A) Comments are used to hide malicious code within the program. B) Comments are only for experienced programmers and not beginners. C) Comments are unnecessary and slow down the code execution. D) Comments provide clarity and context to the code. Show Answer Correct Answer: D) Comments provide clarity and context to the code. 51. Which of these collections defines a DICTIONARY? A) {"apple", "banana", "cherry"}. B) ("apple", "banana", "cherry"). C) {"name": "apple", "color": "green"}. D) ["apple", "banana", "cherry"]. Show Answer Correct Answer: C) {"name": "apple", "color": "green"}. 52. Which function is used to create a cursor object? A) Cur=con.cursor(). B) Cur=con.cursor. C) Cur=concursor(). D) Cur=con.mycurosr. Show Answer Correct Answer: A) Cur=con.cursor(). 53. Which of the following is not a core data type in Python programming? A) Lists. B) Tuples. C) Dictionary. D) Class. Show Answer Correct Answer: D) Class. 54. What does % math operator do? A) To get the remainder of the two numbers. B) To get the percentage from those two numbers. C) To get the quotient of the two numbers. D) To get the square root of two numbers. Show Answer Correct Answer: A) To get the remainder of the two numbers. 55. What does the abstraction in Python allow programmers to do? A) Focus on writing hardware-specific code. B) Directly interact with the hardware. C) Create low-level machine code. D) Focus on writing code without dealing with hardware-specific details. Show Answer Correct Answer: D) Focus on writing code without dealing with hardware-specific details. 56. Let's say we create a DataFrame df = pd.DataFrame({'A':[1, 2, 3], 'B':[4, 5, 6]})What will df.shape return? A) (4, 2). B) 6. C) (2, 3). D) (3, 2). Show Answer Correct Answer: D) (3, 2). 57. Suppose t = (1, 2, 4, 3), which of the following is incorrect? A) T[3] = 45. B) Print(len(t)). C) Print(t[3]). D) Print(max(t)). Show Answer Correct Answer: A) T[3] = 45. 58. How do you add comments in Python code? A) Use the '/* */' symbols to add comments in Python code. B) Use the '//' symbol to add comments in Python code. C) Use the '#' symbol to add comments in Python code. D) Use the '//' symbol to add comments in Java code. Show Answer Correct Answer: C) Use the '#' symbol to add comments in Python code. 59. What is the return statement used for in Python functions? A) To exit the function and return a value back to the caller. B) To import external libraries. C) To print a message to the console. D) To loop through a list of elements. Show Answer Correct Answer: A) To exit the function and return a value back to the caller. 60. The ..... symbol is used at the beginning of a flow chart. A) Circle. B) Rectangle. C) Diamond. D) None of these. Show Answer Correct Answer: A) Circle. ← PreviousNext →Related QuizzesScience QuizzesClass 12 QuizzesClass 12 Computer Science Chapter 2 Advanced Python Programming Quiz 1Class 12 Computer Science Chapter 2 Advanced Python Programming Quiz 2Class 12 Computer Science Chapter 2 Advanced Python Programming Quiz 4Class 12 Computer Science Chapter 1 Data Structures Using Python QuizClass 12 Computer Science Chapter 3 Database Management Systems QuizClass 12 Computer Science Chapter 4 Structured Query Language (Sql) QuizClass 12 Computer Science Chapter 5 Networking And Cyber Security QuizClass 12 Computer Science Chapter 6 Boolean Algebra And Logic Gates Quiz 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books