This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 14 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 14 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which of the following is a string in Python? A) "Hello". B) 12.3. C) Hello. D) 123. Show Answer Correct Answer: A) "Hello". 2. How do you access the first element of a list named 'colours'? A) Colours{0}. B) Colours(0). C) Colours[0]. D) Colours.0. Show Answer Correct Answer: C) Colours[0]. 3. Why is it called 'Python'? A) It was created by someone called Mr Python. B) The guy who created it loves Monty Python films. C) You can create a game on python called snake. D) The guy who created it loves snakes. Show Answer Correct Answer: B) The guy who created it loves Monty Python films. 4. How do you handle errors in Python? A) Catch-throw. B) Try-catch. C) Do-except. D) Try-except. Show Answer Correct Answer: D) Try-except. 5. A set of instructions a computer follows to do a task is called a- A) Program. B) Application. C) Algorithm. D) Software. Show Answer Correct Answer: A) Program. 6. Which of the following is a reserved keyword in Python? A) If. B) Loop. C) Variable. D) Function. Show Answer Correct Answer: A) If. 7. What will print("Hi" + '' there") show? A) Hithere. B) "Hi there". C) Hi there. D) Hi+there. Show Answer Correct Answer: C) Hi there. 8. What is one of the uses of Python mentioned in the text? A) Building web apps. B) Developing operating systems. C) Designing graphics. D) Creating video games. Show Answer Correct Answer: A) Building web apps. 9. What is programming? A) Creating hardware components. B) Designing computer graphics. C) Writing reports about computers. D) Passing instructions to a machine to solve a problem. Show Answer Correct Answer: D) Passing instructions to a machine to solve a problem. 10. What will be the output of the following code? x = 5 if x > 3:print("Greater") else:print("Smaller") A) Greater. B) Smaller. C) Error. D) 5. Show Answer Correct Answer: A) Greater. 11. What does IDE stand for in Python programming? A) Integrated Design Editor. B) Internal Data Explorer. C) Internet Development Environment. D) Integrated Development Environment. Show Answer Correct Answer: D) Integrated Development Environment. 12. Which statement is true about variable names in Python? A) Variable names cannot use underscores. B) Variable names can start with a number. C) Variable names can contain spaces. D) Variable names are case-sensitive. Show Answer Correct Answer: D) Variable names are case-sensitive. 13. What makes Python a versatile programming language? A) It can be used on different platforms and supports multiple programming paradigms. B) It is only used for web development. C) It has a complex syntax. D) It is expensive to use. Show Answer Correct Answer: A) It can be used on different platforms and supports multiple programming paradigms. 14. Define the term algorithm A) A set of steps to to go the second floor. B) A set of steps to to climb a mountain. C) A set of steps to solve a problem. D) A set of steps to to the plane. Show Answer Correct Answer: C) A set of steps to solve a problem. 15. How many times does the following program print the word 'computer':word= "computer" for num in range(1, 6):print(word) A) 1. B) 0. C) 5. D) 6. Show Answer Correct Answer: C) 5. 16. Given fruits = ('apple', 'banana', 'cherry'), what does the expression 'cherry' in fruits evaluate to? A) Index position integer. B) True boolean value. C) False boolean value. D) Raises a TypeError. Show Answer Correct Answer: B) True boolean value. 17. What must you start your line of code with so that the program knows what code you are using? A) Import turtle. B) From turtle import turtle. C) From turtle import *. D) Turtle.start(). Show Answer Correct Answer: C) From turtle import *. 18. Write the output of the following:x = int(7) + int('9'); print(x) A) 79. B) None of the above. C) 16. D) Error. Show Answer Correct Answer: C) 16. 19. Why was Python (TM) developed? A) To go back to the old way of programming. B) Python was developed by accident. C) To make it easier to learn Java. D) To create a programming language for students in grade school. Show Answer Correct Answer: D) To create a programming language for students in grade school. 20. Which of following language is called as interpreter language . A) Java. B) C++. C) Python. D) C. Show Answer Correct Answer: C) Python. 21. Which of the following is an example of a Python string? A) 3.14. B) "42". C) 42. D) True. Show Answer Correct Answer: B) "42". 22. The term which describes errors in a programme A) Debug. B) Bug. C) Syntax. D) Logic error. E) Syntax error. Show Answer Correct Answer: B) Bug. 23. What does the Python Turtle Library allow you to do? A) Play online music. B) Control a physical robot. C) Create graphics and drawings using code. D) Perform advanced mathematical calculations. Show Answer Correct Answer: C) Create graphics and drawings using code. 24. Used to add annotation to the code: A) %. B) #. C) *. D) &. Show Answer Correct Answer: B) #. 25. Python is an example of which type of programming language? A) Machine-level. B) Low-level. C) Assembly-level. D) High-level. Show Answer Correct Answer: D) High-level. 26. What is the radius of a circle as used in Tracy's commands? A) Circumference. B) Area of the circle. C) Distance from center to edge. D) Diameter. Show Answer Correct Answer: C) Distance from center to edge. 27. Low-level languages are more efficient that high-level ones. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 28. What will the output be from the following code?print("Hello world!") A) Print(Hello world!). B) Hello world!. C) "Hello world!". D) SyntaxError. Show Answer Correct Answer: B) Hello world!. 29. What will be the output of the following code? 'print("Learning", "Python", "is fun!")' A) "Learning" "Python" "is fun!". B) LearningPythonisfun!. C) LearningPythonis fun!. D) Learning Python is fun!. Show Answer Correct Answer: D) Learning Python is fun!. 30. Which of the following statements about variables is true? A) Variables can only store numbers. B) Variables can store strings, numbers, and other data types. C) Variables must be declared with a type. D) Variables cannot change their value once set. Show Answer Correct Answer: B) Variables can store strings, numbers, and other data types. 31. What is an error in programming? A) A type of statement. B) A type of function. C) A correct output. D) A mistake or problem in the code that prevents it from running correctly. Show Answer Correct Answer: D) A mistake or problem in the code that prevents it from running correctly. 32. What is the primary purpose of a computer program? A) To provide instructions for the computer to execute. B) To store data and information. C) To communicate with other Human. D) None of the above. Show Answer Correct Answer: A) To provide instructions for the computer to execute. 33. Python (TM) is owned and managed by A) Microsoft (c). B) Sun Microsystems (c). C) Python (TM) is open source and free to use. D) Google (c). Show Answer Correct Answer: C) Python (TM) is open source and free to use. 34. Which of the following is NOT a Python data type? A) Float. B) Int. C) Char. D) Complex. Show Answer Correct Answer: C) Char. 35. Which of the following is not correct about Python? A) Python is based on ABC language. B) Python is an open source language. C) Python is a compiled language. D) Python is developed by Guido Van Rossum. Show Answer Correct Answer: C) Python is a compiled language. 36. L = [1, 3, 5, 7, 9]print(L.pop(-3), end = ' ')print(L.remove(L[0]), end = ' ')print(L) A) 5 1 [3, 7, 9]. B) 5 None [1, 3, 7, 9]. C) 5 None [3, 7, 9]. D) None of the above. Show Answer Correct Answer: C) 5 None [3, 7, 9]. 37. Which of these professions might use Python? A) Athlete. B) Chef. C) Web Developer. D) Artist. Show Answer Correct Answer: C) Web Developer. 38. Which is the most appropriate data type for: "13th December" A) Float. B) String. C) Integer. D) Boolean. Show Answer Correct Answer: B) String. 39. What command is used to start drawing a circle? A) Triangle. B) Square. C) Circle. D) Line. Show Answer Correct Answer: C) Circle. 40. Which of the following is a programming language? A) Python. B) HTML. C) English. D) All of the above. Show Answer Correct Answer: A) Python. 41. What keyword is used to exit a loop early? A) Break. B) Skip. C) Continue. D) Exit. Show Answer Correct Answer: A) Break. 42. Which errors are detected by the Python IDLE? A) Syntax errors. B) Logical errors. C) Runtime errors. D) Semantic errors. Show Answer Correct Answer: A) Syntax errors. 43. What will print(len('Python')) output? A) 5. B) Error. C) 6. D) 7. Show Answer Correct Answer: C) 6. 44. Which of these is the correct code for creating a list of names? A) NameList = ("John", "Harry", "Jesse", "John", "Harry", "Harry"). B) NameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]. C) NameList = John, Harry, Jesse, John, Harry, Harry. D) NameList = [John, Harry, Jesse, John, Harry, Harry]. Show Answer Correct Answer: B) NameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]. 45. What is the purpose of importing the randint function from the random module? A) To allow the program to compare two numbers. B) To generate random integers within a specified range. C) To check if a condition is true or false. D) To handle user input more effectively. Show Answer Correct Answer: B) To generate random integers within a specified range. 46. What will the following code do? "'pythontry:print(1 / 0)except ZeroDivisionError:print("Cannot divide by zero") "' A) Print "Cannot divide by zero". B) Print 1. C) Print 0. D) Cause an error. Show Answer Correct Answer: A) Print "Cannot divide by zero". 47. Number1 = 15number2 = 10total = number1 + number2What is total? A) 1510. B) 25. C) 10. D) 15. Show Answer Correct Answer: B) 25. 48. What will the following code output?if not 0:print("True")else:print("False") A) True. B) False. C) None. D) Error. Show Answer Correct Answer: A) True. 49. What is the purpose of the 'return' statement in a function? A) To define the parameters of a function. B) To end the execution of a function immediately. C) To create a loop within a function. D) The purpose of the 'return' statement is to provide a value from a function to its caller. Show Answer Correct Answer: D) The purpose of the 'return' statement is to provide a value from a function to its caller. 50. Smallest element of Python coding is called ..... A) Keywords. B) Identifiers. C) Token. D) Delimiters. Show Answer Correct Answer: C) Token. 51. What does the following code do? "'pythonname = "Sam"print(name) "' A) Prints "Sam". B) Prints "name". C) Prints name. D) Prints Sam. Show Answer Correct Answer: D) Prints Sam. 52. Which line of code will display the message 'Hello World!' on the screen when it is run in Python? A) Print "Hello World!". B) Output ("Hello World"). C) Print ("Hello World!"). D) Display ("Hello World"). Show Answer Correct Answer: C) Print ("Hello World!"). 53. Which keyword is used for decision making? A) If. B) Return. C) Loop. D) Print. Show Answer Correct Answer: A) If. 54. How do you take input from the user? A) Input (). B) Scanf (). C) Console (). D) All of the above. Show Answer Correct Answer: A) Input (). 55. A disadvantage of Python is it is harder to debug than other higher level programming languages. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 56. What are python comments? A) Line of comments are ignored when writing code in python. B) Line of comments are not in words when writing code in python. C) Line of comments are ignored when writing code in python. D) Line of comments are not ignored when writing code in python. Show Answer Correct Answer: A) Line of comments are ignored when writing code in python. 57. What is the name of the programming language we are learning? A) Python. B) Scratch. C) Monty Python. D) Turtle. Show Answer Correct Answer: A) Python. 58. What is the output of the expression 8 * 2 in Python? A) 18. B) 14. C) 12. D) 16. Show Answer Correct Answer: D) 16. 59. Which of the following is NOT a type of variable in Python? A) Global variable. B) Output variable. C) Static variable. D) Local variable. Show Answer Correct Answer: C) Static variable. 60. Tuples in Python have a limited set of methods. Which statement is accurate? A) They include sort and extend methods. B) They have dozens of mutation methods. C) They only provide count and index. D) They support append and remove too. Show Answer Correct Answer: C) They only provide count and index. ← 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