This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 12 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 12 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. False is an example of what data type? A) String. B) Float. C) Boolean. D) None of the above. Show Answer Correct Answer: C) Boolean. 2. Which of the following can not be used as an identifier? A) All of the above. B) Max. C) Eval. D) Pass. Show Answer Correct Answer: D) Pass. 3. Which statement is used to skip the current iteration and move to the next one? A) Pass. B) Continue. C) Break. D) Skip. Show Answer Correct Answer: B) Continue. 4. What is the main objective of the Python programming class? A) To learn advanced Python libraries. B) To write small programs in Python. C) To understand the history of Python. D) To create a web application. Show Answer Correct Answer: B) To write small programs in Python. 5. Which of these stores a piece of data, and gives it a specific name? A) Modulo. B) Interpreter. C) Whitespace. D) Variable. Show Answer Correct Answer: D) Variable. 6. What does the Python 'print()' function automatically add to ensure that console output appears on separate lines? A) Carriage return and line feed. B) Brackets. C) Commas. D) Semicolons. Show Answer Correct Answer: A) Carriage return and line feed. 7. Which job might involve using Python to build robots? A) Doctor. B) Robotics engineer. C) Teacher. D) Baker. Show Answer Correct Answer: B) Robotics engineer. 8. What data type is "67" ? A) Int. B) Float. C) String. D) Boolean. Show Answer Correct Answer: C) String. 9. Python is a popular programming language used for ..... A) Cooking. B) Web development. C) Gardening. D) Painting. Show Answer Correct Answer: B) Web development. 10. Which symbol is the assignment operator in Python? A) =. B) ==. C) !=. D) +. Show Answer Correct Answer: A) =. 11. How do you define a list in Python? A) A list in Python is defined using angle brackets, e.g., my list = <1, 2, 3>. B) A list in Python is defined using parentheses, e.g., my list = (1, 2, 3). C) A list in Python is defined using square brackets, e.g., my list = [1, 2, 3]. D) A list in Python is defined using curly braces, e.g., my list = {1, 2, 3}. Show Answer Correct Answer: C) A list in Python is defined using square brackets, e.g., my list = [1, 2, 3]. 12. If else statement A) Gets data from the user. B) A decision. C) A loop controlled by a decision. D) Outputs a message on the screen. Show Answer Correct Answer: B) A decision. 13. Which function is used to read a CSV file into a Pandas DataFrame? A) Pd.read csv(). B) Pd.load csv(). C) Pd.open csv(). D) Pd.csv(). Show Answer Correct Answer: A) Pd.read csv(). 14. In the expression a + b, what are a and b called? A) Operators. B) Operands. C) Expressions. D) Literals. Show Answer Correct Answer: B) Operands. 15. Which keyword is used to define a function? A) Def. B) Define. C) Function. D) Func. Show Answer Correct Answer: A) Def. 16. What is the official website to download Python? A) Https://www.python.org/downloads/. B) Https://www.py.org/download/. C) Https://www.downloadpython.org/. D) Https://www.python.com/downloads/. Show Answer Correct Answer: A) Https://www.python.org/downloads/. 17. Is python an interpreted language? A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 18. Which of the following is a valid comment in Python? A) '/* This is a comment */'. B) '# This is a comment'. C) ". D) '// This is a comment'. Show Answer Correct Answer: B) '# This is a comment'. 19. Which of these is a Python list method? A) InsertAt(). B) Add(). C) Push(). D) Append(). Show Answer Correct Answer: D) Append(). 20. Which of the following is an invalid variable? A) Foo. B) . C) 1st string. D) My string 1. Show Answer Correct Answer: C) 1st string. 21. How many times will the following loop execute?for i in range(5):print(i) A) 5. B) Infinite. C) 6. D) 4. Show Answer Correct Answer: A) 5. 22. Your program asks people how much money something costs and saves it as a variable named "price" . Assuming users enter the amount correctly, which command will result in the value containing dollars BUT NO cents. A) Cost = price. B) Cost = int(price). C) Cost = float(price). D) Cost = str(price). Show Answer Correct Answer: B) Cost = int(price). 23. Which of the following is used to create a list in Python? A) Curly braces {}. B) Square brackets []. C) Parentheses (). D) Angle brackets <>. Show Answer Correct Answer: B) Square brackets []. 24. What will the following code output if diceroll equals 4?from random import randintdiceroll = 4if diceroll > 3:print(diceroll, "is a large roll")else:print(diceroll, "is a small roll") A) "4 is a large roll". B) "4 is a small roll". C) No output. D) "Yet you rolled a 4". Show Answer Correct Answer: A) "4 is a large roll". 25. What is the correct function to display output to the console in Python? A) Write( ). B) Display( ). C) Echo( ). D) Print( ). Show Answer Correct Answer: D) Print( ). 26. Identify the keyword that accesses an instance's attributes when three objects are created. A) Init . B) Inheritance. C) Self. D) Class. Show Answer Correct Answer: A) Init . 27. What is the output of the following code?for i in range(3):print(i) A) 1 2. B) 0 1 2 3. C) 1 2 3. D) 0 1 2. Show Answer Correct Answer: D) 0 1 2. 28. Which data type stores True or False? A) Int. B) Bool. C) Float. D) Str. Show Answer Correct Answer: B) Bool. 29. What is the output of the following code:print(type(5) is int)? A) True. B) False. C) Int. D) 5. Show Answer Correct Answer: A) True. 30. Read the Python program below:location = "Leeds" print("I live in", location)When this program is executed, what will be displayed on the screen? A) "I live in", Leeds. B) I live in Leeds. C) "I live in", location. D) I live in location. Show Answer Correct Answer: B) I live in Leeds. 31. Which of the following store data in pair? A) Tuple. B) Dictionary. C) List. D) String. Show Answer Correct Answer: B) Dictionary. 32. Is "You were born in" a string? A) Yes, because it is text inside quotes. B) Yes, because it has the + sign. C) No, because it is not a variable. D) No, because it has spaces. Show Answer Correct Answer: A) Yes, because it is text inside quotes. 33. What is the correct syntax to make Tracy move forward 100 pixels? A) Go(100). B) Move 100. C) Forward 100. D) Forward(100). Show Answer Correct Answer: D) Forward(100). 34. Which variable correctly stores a string value? A) Greeting = hello. B) Greeting = "hello". C) Greeting = 81. D) Greeting = 45.8. Show Answer Correct Answer: B) Greeting = "hello". 35. Which of the following is used to define a class in Python? A) Object. B) Define. C) Class. D) Struct. Show Answer Correct Answer: C) Class. 36. True is a boolean A) True. B) False. C) Neither. D) None of the above. Show Answer Correct Answer: A) True. 37. How do you handle exceptions in Python? A) Use if-else statements to manage exceptions in Python. B) Ignore exceptions and continue execution in Python. C) Use try-except blocks to handle exceptions in Python. D) Utilize switch-case structures for exception handling in Python. Show Answer Correct Answer: C) Use try-except blocks to handle exceptions in Python. 38. Which statement is true regarding how computers communicate? A) Computers use multiple programming languages to communicate. B) Computers only use one programming language. C) Computers do not require programming languages. D) Computers communicate using natural human languages. Show Answer Correct Answer: A) Computers use multiple programming languages to communicate. 39. What is the minimum passing mark for the Semester End Exam (SEE) as a percentage of the maximum marks? A) 25%. B) 40%. C) 35%. D) 50%. Show Answer Correct Answer: C) 35%. 40. Used in python to make decisions A) If statement. B) Print command. C) Input command. D) Logical operators. Show Answer Correct Answer: A) If statement. 41. What will be the output of the following Python program? x = 5 x = x + 10 print(x) A) 5. B) 10. C) 20. D) 15. Show Answer Correct Answer: D) 15. 42. What is the result of the expression 10 // 3? A) 3. B) 1. C) 3.0. D) 3.333. Show Answer Correct Answer: A) 3. 43. Which of the following Python code snippets asks the user to enter their name and greets them? A) Print('Enter your name:')name = input()print('Goodbye, ' + name). B) Print('Hello, World!'). C) Name = input('Enter your age:')print('Hello, ' + name + '!'). D) Name = input('Enter your name:')print('Hello, ' + name + '!'). Show Answer Correct Answer: D) Name = input('Enter your name:')print('Hello, ' + name + '!'). 44. Which of the following is an example of a famous application developed using Python? A) Microsoft Word. B) WhatsApp. C) Minecraft. D) Instagram. Show Answer Correct Answer: D) Instagram. 45. A, b, c=10, 20, 30p, q, r=c-5, a+3, b-4print ('A, B, C:', a, b, c)print ('P, Q, R:', p, q, r) A) A, B, C:10 20 30P, Q, R:24 12 16. B) A, B, C:10 20 30P, Q, R:25 13 18. C) A, B, C:10 20 30P, Q, R:25 14 16. D) A, B, C:10 20 30P, Q, R:25 13 16. Show Answer Correct Answer: D) A, B, C:10 20 30P, Q, R:25 13 16. 46. Which of the following makes Python easy to learn? A) Complex syntax. B) Simple and readable code. C) Requires extensive memory management. D) Requires pre-compilation. Show Answer Correct Answer: B) Simple and readable code. 47. Which of the following is not a mode of interacting with Python? A) Hybrid Mode. B) Script Mode. C) Interactive Mode. D) Batch Mode. Show Answer Correct Answer: A) Hybrid Mode. 48. How do you print a variable 'x' in Python? A) 'echo x'. B) 'printf(x)'. C) 'console.log(x)'. D) 'print(x)'. Show Answer Correct Answer: D) 'print(x)'. 49. Which of the following is the correct way to display the word "Hello" on the screen in Python? A) Print Hello. B) Display("Hello"). C) Echo("Hello"). D) Print("Hello"). Show Answer Correct Answer: D) Print("Hello"). 50. Which of the following is a valid way to create a list in Python? A) List = (). B) List = []. C) List = {}. D) List = <>. Show Answer Correct Answer: B) List = []. 51. A note to the programmer that tells about the code is called a- A) Description. B) Annotation. C) Comment. D) Documentation. Show Answer Correct Answer: C) Comment. 52. What symbol is used for multiplication in Python? A) #. B) *. C) X. D) X. Show Answer Correct Answer: B) *. 53. What does len('apple') return? A) Error. B) 4. C) 5. D) 6. Show Answer Correct Answer: C) 5. 54. Which of the following is a characteristic of Python? A) None of the above. B) Compiled language. C) Interpreted language. D) Static typing. Show Answer Correct Answer: C) Interpreted language. 55. Read the Python program below:number = 13if number == 0:print("zero")else:print(number)number = 0When this program is executed, what will be displayed on the screen? A) Nothing will be displayed on the screen. B) 13zero. C) 13. D) 13zero0. Show Answer Correct Answer: C) 13. 56. What is the default package manager for Python? A) Pip. B) Conda. C) Npm. D) Brew. Show Answer Correct Answer: A) Pip. 57. What is the purpose of the subprogram turtle.Turtle() in the turtle library module? A) Moves the turtle forward. B) Turns the turtle clockwise. C) Creates a new turtle with a variable name. D) Makes the turtle invisible. Show Answer Correct Answer: C) Creates a new turtle with a variable name. 58. Consider the list:myList=["r", "o", "y", "g", "b", "i", "v"]What prints from the following statement?print(myList[0:3]) A) ['r', 'o', 'y']. B) [r, o, y]. C) Nothing, this is an error. D) ['r', 'o', 'y', 'g']. Show Answer Correct Answer: A) ['r', 'o', 'y']. 59. How can Python help in robotics? A) Building kitchen cabinets. B) Writing storybooks. C) Programming robots to do tasks. D) Making sandwiches. Show Answer Correct Answer: C) Programming robots to do tasks. 60. PyCharm needs Python interpreter installed to work. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. ← PreviousNext →Related QuizzesScience QuizzesClass 11 QuizzesClass 11 Computer Science Chapter 2 Introduction To Python Quiz 1Class 11 Computer Science Chapter 2 Introduction To Python Quiz 2Class 11 Computer Science Chapter 2 Introduction To Python Quiz 3Class 11 Computer Science Chapter 2 Introduction To Python Quiz 4Class 11 Computer Science Chapter 2 Introduction To Python Quiz 5Class 11 Computer Science Chapter 2 Introduction To Python Quiz 6Class 11 Computer Science Chapter 2 Introduction To Python Quiz 7Class 11 Computer Science Chapter 2 Introduction To Python Quiz 8 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books