This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 22 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 22 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which of the following is an integer (not a string)? A) 13. B) "Year 9". C) "13 years old". D) "13". Show Answer Correct Answer: A) 13. 2. Which of the following is the correct way to get an integer input from the user in Python? A) 'age = str(input("Enter your age: "))'. B) 'age = input("Enter your age: ")'. C) 'age = int(input("Enter your age: "))'. D) 'age = float(input("Enter your age: "))'. Show Answer Correct Answer: C) 'age = int(input("Enter your age: "))'. 3. Name = "Mr Gregson" print("Welcome", name)When this program is executed, what will be displayed on the screen? A) Welcome Mr Gregson. B) Welcome name. C) "Welcome", name. D) "Welcome", "Mr Gregson". Show Answer Correct Answer: A) Welcome Mr Gregson. 4. What type of error occurs if you try to print a variable named 'mesage' when you have only defined a variable named 'message'? A) ValueError. B) NameError. C) SyntaxError. D) TypeError. Show Answer Correct Answer: B) NameError. 5. What will the output be from the following code?print("Hello" + "world" + "today") A) Helloworldtoday. B) Hello world today. C) SyntaxError. D) "Hello" "world" "today". Show Answer Correct Answer: A) Helloworldtoday. 6. What command would you use to change the turtle's speed? A) Turtle.speed(). B) Turtle.setSpeed(). C) Turtle.changeSpeed(). D) Turtle.adjustSpeed(). Show Answer Correct Answer: A) Turtle.speed(). 7. Which of the following is a Python command word used to indicate we want to work with DECIMAL numbers A) Float. B) Input. C) Int. D) Print. Show Answer Correct Answer: A) Float. 8. Which data type in Python is immutable? A) Ductionary. B) Set. C) List. D) Tuple. Show Answer Correct Answer: D) Tuple. 9. The opposite of True is: A) 1. B) False. C) None. D) Zero. Show Answer Correct Answer: B) False. 10. Which of the following is a facet of data? A) Structured. B) Unstructured. C) Semi-structured. D) All of the above. Show Answer Correct Answer: D) All of the above. 11. Python uses the traditional ..... character set. A) ASCII. B) MSIIC. C) DCCIS. D) PSCII. Show Answer Correct Answer: A) ASCII. 12. You must import the Random library so the random functions can work A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 13. What does the input() function do in Python? A) Executes a block of code. B) Displays a message on the screen. C) Pauses and waits for user input. D) Saves data to a file. Show Answer Correct Answer: C) Pauses and waits for user input. 14. Identify the below expressions which would result in False?a) False and True b) 1==1 or 2==1c) 1==1 and 2!=1 d) True and 1==1 e) False or 1>2 A) A, e. B) A, c. C) C, d. D) B, c, d. Show Answer Correct Answer: A) A, e. 15. You've created a variable to keep track of a player's score in your video game named:player ..... scoreWhich variable can be typed into your program in order to use it? A) Player score. B) Player Score. C) Player Score. D) Any of these will work. E) None of these will work. Show Answer Correct Answer: E) None of these will work. 16. What is the main purpose of the Turtle Library? A) Generate random numbers. B) Create user interfaces. C) Explore the behavior of turtles in nature. D) Aid in understanding graphic programming concepts. Show Answer Correct Answer: D) Aid in understanding graphic programming concepts. 17. What will be the result of the following import statement?import module ..... name as mod A) You import only the module name attribute. B) You define a function mod within module name. C) You create a new module mod with module name. D) You can access module name using the alias mod. Show Answer Correct Answer: D) You can access module name using the alias mod. 18. A named memory location used to store values in computer is a ..... A) Variable. B) Hard Drive Disk. C) String. D) Casting. Show Answer Correct Answer: A) Variable. 19. Which of the following is the correct way to get user input and store it in a variable called 'city'? A) City = read("Enter your city: "). B) City = scan("Enter your city: "). C) City = input("Enter your city: "). D) City = get("Enter your city: "). Show Answer Correct Answer: C) City = input("Enter your city: "). 20. What are sequence commands? A) The unorder which they are carried out. B) Not sure. C) The order which not they are carried out. D) The order which they are carried out. Show Answer Correct Answer: D) The order which they are carried out. 21. What is printed by the following statement?print("P" not in "APCSP") A) True. B) False. C) Error. D) None of the above. Show Answer Correct Answer: B) False. 22. Which is most appropriate statement to refer to Dynamic Typing. A) The data type of variable is not fixed at run time. B) The data type of a variable is not known. C) The data type of variable is fixed at compile time. D) The data type of variable is fixed at run time. Show Answer Correct Answer: A) The data type of variable is not fixed at run time. 23. What is Script mode? A) In script mode, You write your code in a text file then save it with a .py extension which stands for "Python" . B) You get a large script in this mode. C) It is where you write a short code. D) All of the above. Show Answer Correct Answer: A) In script mode, You write your code in a text file then save it with a .py extension which stands for "Python" . 24. Which of the following is the correct way to declare a variable called 'height' and assign it the value 1.75 (in metres) in Python? A) Height = 1.75. B) Var height = 1.75. C) Height:1.75. D) Let height = 1.75. Show Answer Correct Answer: A) Height = 1.75. 25. A Python program requires ..... to be executed. A) A computer. B) A program called 'the Python translator'. C) A program called 'the Python interpreter'. D) A program called 'a development environment'. Show Answer Correct Answer: C) A program called 'the Python interpreter'. 26. What is the correct way to start a Python program? A) Start code. B) Begin. C) Run. D) Print('Hello'). Show Answer Correct Answer: D) Print('Hello'). 27. What will:print(10 // 3) show? A) 3. B) 3.0. C) 3.33. D) 3.3. Show Answer Correct Answer: A) 3. 28. This is when you convert a variable value from one type to another. A) Masting. B) Declaring. C) Casting. D) Deciding. Show Answer Correct Answer: C) Casting. 29. What is the purpose of the assignment statement in programming? A) To translate programming languages. B) To display messages. C) To execute instructions. D) To assign values to variables. Show Answer Correct Answer: D) To assign values to variables. 30. How do you access elements in a Pandas Series? A) Through a for loop iteration. B) Using indexing or slicing. C) By applying a filter function. D) By using the .get() method. Show Answer Correct Answer: B) Using indexing or slicing. 31. What will be the output of print(5 + 3 * 2)? A) 16. B) 10. C) 13. D) 11. Show Answer Correct Answer: D) 11. 32. Code repeated / looped until a condition has been met or a set number of times. A) Iteration. B) Variable. C) Sequence. D) Selection. Show Answer Correct Answer: A) Iteration. 33. Is the result of the code:print ("Hello World) A) "Hello World". B) Hello World. C) "Hello world. D) Syntax error. Show Answer Correct Answer: D) Syntax error. 34. What is the output of the following code? "'pythontry:print(10 / 0)except ZeroDivisionError:print("Cannot divide by zero!") "' A) 0. B) Error. C) 10. D) Cannot divide by zero!. Show Answer Correct Answer: D) Cannot divide by zero!. 35. Which statement correctly assigns "Sophie" to the variable name? A) Name = input("Sophie"). B) Input("Sophie"). C) Name = print( "Sophie"). D) Name = "Sophie". Show Answer Correct Answer: D) Name = "Sophie". 36. A ..... function is a process in which a function calls itself directly or indirectly. A) User defined. B) Module. C) Recursive. D) Lambda. Show Answer Correct Answer: C) Recursive. 37. What should you do before running a Python program? A) Delete the program. B) Save the program. C) Close the program. D) Restart the computer. Show Answer Correct Answer: B) Save the program. 38. What will be the output of the following code?my ..... list = [1, 2, 3, 4, 5]print(my ..... list[2:4]) A) [2, 3]. B) [4, 5]. C) [1, 2]. D) [3, 4]. Show Answer Correct Answer: D) [3, 4]. 39. A Microsoft word document is saved with the extension .doc (e.g. My project.doc). What extension is used when saving python programs? A) .p. B) .pyt. C) .py. D) .python. Show Answer Correct Answer: C) .py. 40. What is the purpose of output formatting in Python? A) To change the data type of variables. B) To define functions. C) To control how data is displayed. D) To create loops. Show Answer Correct Answer: C) To control how data is displayed. 41. Which value is a Boolean data type? A) 64. B) "cat". C) True. D) 0.5. Show Answer Correct Answer: C) True. 42. Which operator type is used in the expression var ..... 1 > var ..... 2? A) Exponent. B) Greater than. C) Addition. D) Multiplication. Show Answer Correct Answer: B) Greater than. 43. Operator "%" dalam Python digunakan untuk operasi ..... A) Pemangkatan. B) Modulus (sisa bagi). C) Perbandingan. D) Logika. Show Answer Correct Answer: B) Modulus (sisa bagi). 44. Which of the following loop types is primarily used when the number of iterations is known beforehand? A) Repeat-until. B) While. C) Do-while. D) For. Show Answer Correct Answer: D) For. 45. What is computer programming? A) A programming language. B) A type of software. C) Process of writing set of instructions to solve the real life problem. D) A hardware component. Show Answer Correct Answer: C) Process of writing set of instructions to solve the real life problem. 46. Which operator performs floor division in Python? A) //. B) **. C) %. D) /. Show Answer Correct Answer: A) //. 47. What is a script library? A) Pre-written code imported to save time. B) Software that decomposes your scripts. C) A website for coding ideas. D) A type of hardware. Show Answer Correct Answer: A) Pre-written code imported to save time. 48. Password= input("Enter the password")What is the name of this variable? A) Password. B) Pen. C) Post. D) Passback. Show Answer Correct Answer: A) Password. 49. Given the tuple nums = (4, 9, 2, 9), what does len(nums) return? A) It returns 2 elements. B) It returns 3 elements. C) It returns 4 elements. D) It returns 5 elements. Show Answer Correct Answer: C) It returns 4 elements. 50. What is the purpose of variables in programming? A) To execute instructions. B) To display messages. C) To translate programming languages. D) To keep track of values. Show Answer Correct Answer: D) To keep track of values. 51. Contents from beautifulsoup are usually returned as A) Lists. B) Objects. C) Variables. D) Tuples. Show Answer Correct Answer: B) Objects. 52. What will be the output of the following code? "'pythonprint(2 + 3 * 4) "' A) 18. B) 20. C) 14. D) 24. Show Answer Correct Answer: C) 14. 53. How can you import a module in Python? Give an example. A) Require('math'). B) Import math(). C) From math import *. D) Import math. Show Answer Correct Answer: D) Import math. 54. What is the main advantage of using Python for beginners? A) It is clear and easy to read. B) It is the fastest language. C) It requires a lot of setup. D) It has a complex syntax. Show Answer Correct Answer: A) It is clear and easy to read. 55. What is the correct command to install the "requests" library using pip in the terminal? A) Python-m pip install requests. B) Pip install requests. C) Python install requests. D) Python-m install requests. Show Answer Correct Answer: B) Pip install requests. 56. What is the purpose of the input command? A) To run a program. B) To print output. C) To wait for user input. D) To save a file. Show Answer Correct Answer: C) To wait for user input. 57. In which year was Python first released? A) 1989. B) 1995. C) 1991. D) 2000. Show Answer Correct Answer: C) 1991. 58. What is the return type of function id()? A) Float. B) String. C) Int. D) None of the above. Show Answer Correct Answer: C) Int. 59. What is the purpose of the Python Turtle module? A) To manage databases efficiently. B) The purpose of the Python Turtle module is to facilitate learning programming through visual graphics and drawing. C) To create complex web applications. D) To perform advanced mathematical calculations. Show Answer Correct Answer: B) The purpose of the Python Turtle module is to facilitate learning programming through visual graphics and drawing. 60. Choose the correct operators used in python:divide, multiply, add, subtract A) Div, mul, +, -. B) /, *, +, -. C) , x, +, -. D) ~, *, +, -. Show Answer Correct Answer: B) /, *, +, -. ← 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