This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 1 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 1 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is the purpose of the "import requests" statement in a Python file? A) To install the requests library. B) To update the requests library. C) To use the requests library in the code. D) To delete the requests library. Show Answer Correct Answer: C) To use the requests library in the code. 2. Which of the following is a valid way to assign the value 25 to a variable named 'age' in Python? A) 'age = 25'. B) 'age == 25'. C) 'age:= 25'. D) '25 = age'. Show Answer Correct Answer: A) 'age = 25'. 3. What operator would I need to take 5 from 10? A) /. B) *. C) +. D) -. Show Answer Correct Answer: D) -. 4. What is an interpreted language? A) An interpreted language is only used for web development. B) An interpreted language is compiled before execution. C) An interpreted language is executed directly by an interpreter at runtime. D) An interpreted language requires a virtual machine to run. Show Answer Correct Answer: C) An interpreted language is executed directly by an interpreter at runtime. 5. What does the 'sequence' in programming constructs refer to? A) The execution of instructions one after another from the top to the bottom of the file. B) The order in which variables are declared. C) The indentation of code segments. D) The loop that executes while a condition is true. Show Answer Correct Answer: A) The execution of instructions one after another from the top to the bottom of the file. 6. Keyword mana yang digunakan untuk mendefinisikan fungsi di Python? A) Def. B) Define. C) Lambda. D) Function. Show Answer Correct Answer: A) Def. 7. What is the output of the following code?x = 10; print(x + 5) A) 20. B) 10. C) 15. D) 5. Show Answer Correct Answer: C) 15. 8. What does the string subprogram .find() return if the is not found in? A) An exception. B) 1. C) 0. D) -1. Show Answer Correct Answer: D) -1. 9. Who created Python? A) Bjarne Stroustrup. B) Dennis Ritchie. C) Guido van Rossum. D) James Gosling. Show Answer Correct Answer: C) Guido van Rossum. 10. What does the turtle library subprogram 'penup()' do? A) Changes the color of the pen. B) Puts the pen down. C) Draws a circle. D) Lifts the pen up. Show Answer Correct Answer: D) Lifts the pen up. 11. A syntax error means your code has a 'grammar' mistake or you used symbols/operationsincorrectly A) False. B) True. C) All the above. D) None of the above. Show Answer Correct Answer: B) True. 12. Which data structure stores elements as key-value pairs? A) List. B) Tuple. C) Set. D) Dictionary. Show Answer Correct Answer: D) Dictionary. 13. What is the output of the following code snippet?my ..... list = [1, 2, 3, 4, 5] print(len(my ..... list)) A) 5. B) 3. C) 6. D) 2. Show Answer Correct Answer: A) 5. 14. Which function is used to get user input? A) Scan(). B) Get(). C) Read(). D) Input(). Show Answer Correct Answer: D) Input(). 15. In which year was Python created? A) 2000. B) 1989. C) 1995. D) 1991. Show Answer Correct Answer: D) 1991. 16. List are the simple definition of Python Programming, EXCEPT ..... A) Low Level. B) Interactive. C) Interpreted. D) Object Oriented. Show Answer Correct Answer: A) Low Level. 17. Which of the following is the correct way to assign the value 25 to a variable called 'distance'? A) Distance == 25. B) Distance:= 25. C) 25 = distance. D) Distance = 25. Show Answer Correct Answer: D) Distance = 25. 18. Read the Python program below:b = 42 a = 13print(a, b)When this program is executed, what will be displayed on the screen? A) 13 42. B) 42 13. C) A b. D) There is an error in the program because variables a and b are not assigned values in the right order. Show Answer Correct Answer: A) 13 42. 19. What will print(type(5)) output? A) Str. B) Float. C) Bool. D) Int. Show Answer Correct Answer: D) Int. 20. What is the purpose of the 'pass' keyword in exception handling? A) To raise an exception. B) To ignore the exception. C) To handle the exception. D) To print the exception. Show Answer Correct Answer: B) To ignore the exception. 21. What is a variable in Python? A) A container for storing data. B) A type of loop. C) A fixed value. D) A function. Show Answer Correct Answer: A) A container for storing data. 22. Which of the following is valid operator? A) At. B) In. C) It. D) On. Show Answer Correct Answer: B) In. 23. Which extension is used for Python files? A) .cpp. B) .java. C) .py. D) .txt. Show Answer Correct Answer: C) .py. 24. Which command allows the user to type answers? A) Query(). B) Ask(). C) Print(). D) Input(). Show Answer Correct Answer: D) Input(). 25. If the PRINT function is correct it appears as ..... A) Purple. B) Purple and lowercase. C) Lowercase only. D) Purple and uppercase. Show Answer Correct Answer: B) Purple and lowercase. 26. The terms used to refer to variable's address in the memory and value to which a variable is bound A) Lvalue and rvalue respectively. B) Rvalue and lvalue respectively. C) Lvalues. D) Rvalues. Show Answer Correct Answer: A) Lvalue and rvalue respectively. 27. What is debugging in programming? A) Writing new code. B) The process of finding and fixing errors in code. C) Creating complex algorithms. D) Running the code without errors. Show Answer Correct Answer: B) The process of finding and fixing errors in code. 28. Language translator convert ..... code to ..... code. A) Machine, Source. B) Source, Object. C) None of the above. D) Object, Source. Show Answer Correct Answer: B) Source, Object. 29. Which of the following is a key feature of PyCharm for Python? A) Basic text editing tools. B) No support for version control. C) Limited debugging capabilities. D) Smart code completion & analysis. Show Answer Correct Answer: D) Smart code completion & analysis. 30. What does the = operator do in Python? A) Divides two numbers. B) Compares two values. C) Checks for equality. D) Assigns a value to a variable. Show Answer Correct Answer: D) Assigns a value to a variable. 31. Can we use reserved names as variable name A) True. B) False. C) I don't know. D) None of the above. Show Answer Correct Answer: B) False. 32. What is the output of:print(2 + 3)? A) 2+3. B) 23. C) 6. D) 5. Show Answer Correct Answer: D) 5. 33. Which field uses Python to analyze large sets of data? A) Teaching yoga. B) Painting. C) Gardening. D) Data analysis. Show Answer Correct Answer: D) Data analysis. 34. What will this code print?x = 2y = 3print(x ** y) A) 5. B) 6. C) 8. D) 9. Show Answer Correct Answer: C) 8. 35. Koji je izlaz za print('Hej' + ' Svijete')? A) Hej, Svijete. B) Hej Svijete!. C) HejSvijete. D) Hej Svijete. Show Answer Correct Answer: D) Hej Svijete. 36. What is the correct way to define a string in Python? A) Name = 'Abhishek'. B) Name = Abhishek. C) Name = ""Abhishek"". D) None of the above. Show Answer Correct Answer: A) Name = 'Abhishek'. 37. The correct way to write a variable in Python? A) My variable is 10. B) My variable = 10. C) My variable:10. D) My variable = 10. Show Answer Correct Answer: B) My variable = 10. 38. According to Guido van Rossum's goals for Python in 1999, what did he envision for the language? A) To be exclusive for Unix/C hackers. B) To be a descendant of ABC. C) To be an easy and intuitive language just as powerful as major competitors. D) To have a closed-source development model. Show Answer Correct Answer: C) To be an easy and intuitive language just as powerful as major competitors. 39. Which of the following is a correctly-formatted comment? A) &comment. B) !comment. C) #comment. D) "" Comment" ". Show Answer Correct Answer: C) #comment. 40. What will be the output of the following code?def add(a, b):return a + bprint(add(2, 3)) A) 23. B) 5. C) Error. D) None. Show Answer Correct Answer: B) 5. 41. Which of these is a Boolean value? A) True. B) 'boolean'. C) True. D) 12. Show Answer Correct Answer: A) True. 42. Which statement is used to exit a loop in Python? A) Stop. B) Break. C) Exit. D) Continue. Show Answer Correct Answer: B) Break. 43. What does 'input()' do? A) Gives output. B) Takes data from user. C) Prints data. D) Loops forever. Show Answer Correct Answer: B) Takes data from user. 44. Which line correctly creates the variable shown in the slides? A) Place of birth = "London". B) Place of birth = London. C) Place of birth == "London". D) "place of birth" = "London". Show Answer Correct Answer: A) Place of birth = "London". 45. Which loop is used when the number of iterations is known? A) Repeat-until. B) Do-while. C) While. D) For. Show Answer Correct Answer: D) For. 46. What is the output of the following code? "'pythonprint("5" + "3") "' A) 8. B) Error. C) 5 3. D) 53. Show Answer Correct Answer: D) 53. 47. What is a function in Python? A) A function in Python is a variable that stores data. B) A function in Python is a built-in library for data analysis. C) A function in Python is a type of loop that iterates over a sequence. D) A function in Python is a defined block of code that performs a specific task and can take inputs and return outputs. Show Answer Correct Answer: D) A function in Python is a defined block of code that performs a specific task and can take inputs and return outputs. 48. Which of the following is a feature of Python's cross-platform compatibility? A) Python can only run on Windows operating systems. B) Python can run on multiple operating systems such as Windows, macOS, and Linux. C) Python is limited to Linux-based systems. D) Python can run only on mobile platforms. Show Answer Correct Answer: B) Python can run on multiple operating systems such as Windows, macOS, and Linux. 49. KEYWORDS ARE ALSO CALLED ..... A) RESERVED WORDS. B) VARIABLES. C) FOR STATEMENTS. D) None of the above. Show Answer Correct Answer: A) RESERVED WORDS. 50. What does term 'debug' mean: A) Looking at the code. B) A set of instructions. C) Identify errors and fix them. D) Making a calculation. Show Answer Correct Answer: C) Identify errors and fix them. 51. An escape sequence is represented by ..... slash followed by one or two characters. A) Double. B) Forward. C) Back. D) None of the above. Show Answer Correct Answer: C) Back. 52. Which line is correct? A) From turtle inport *. B) From turtle import *. C) From Turtle import *. D) Form turtle import *. Show Answer Correct Answer: B) From turtle import *. 53. How do you write a single-line comment in Python? A) /*. B) #. C) //. D) . Show Answer Correct Answer: B) #. 54. Which of the following combinations accurately matches mathematicalsymbols with their respective operations? A) + for addition, -for subtraction. B) ** for multiplication, % for subtraction. C) % for multiplication, ** for division. D) * for exponentiation, / for modulus. Show Answer Correct Answer: A) + for addition, -for subtraction. 55. Which of the following is a valid way to assign the value 5 to a variable named 'length' in Python? A) Length:= 5. B) Let length = 5. C) Length = 5. D) 5 = length. Show Answer Correct Answer: C) Length = 5. 56. What can you create using Python? A) A song. B) A painting. C) A car. D) A website. Show Answer Correct Answer: D) A website. 57. How do you create a variable with the numeric value 5? A) X=5. B) X=int(5). C) Both are correct. D) None of the above. Show Answer Correct Answer: C) Both are correct. 58. Python is an interpreted language.When the code is run. What happens? A) Read line of code three at time. B) Read line of code twice at time. C) Not sure. D) Read line of code one at time. Show Answer Correct Answer: D) Read line of code one at time. 59. Which of the following is a valid variable name in Python? A) First-variable. B) FirstVariable. C) First variable. D) 1st variable. Show Answer Correct Answer: B) FirstVariable. 60. What is the purpose of using 'try' and 'except' in Python? A) To handle exceptions. B) To create errors. C) To ignore errors. D) To stop the program. Show Answer Correct Answer: A) To handle exceptions. Next →Related QuizzesScience QuizzesClass 11 QuizzesClass 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 8Class 11 Computer Science Chapter 2 Introduction To Python Quiz 9 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books