This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 20 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 20 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Find the outputa = "5"print(type(a)) A) . B) . C) . D) None of the above. Show Answer Correct Answer: B) . 2. What is Python primarily used for? A) Web development, data analysis, artificial intelligence, scientific computing, automation, and scripting. B) Social media management, content creation, email marketing, and SEO optimization. C) Graphic design, video editing, web hosting, and cloud storage. D) Game development, mobile apps, system programming, and database management. Show Answer Correct Answer: A) Web development, data analysis, artificial intelligence, scientific computing, automation, and scripting. 3. The data type of '123' is: A) Str. B) Int. C) Bool. D) Float. Show Answer Correct Answer: A) Str. 4. THE SMALLEST INDIVIDUAL UNIT IN A PROGRAM IS KNOWN AS A ..... A) TOKEN. B) ASSET. C) SENTENCE. D) None of the above. Show Answer Correct Answer: A) TOKEN. 5. What is the output of the following code? print(2 + 3 * 4) A) 20. B) 12. C) 14. D) 10. Show Answer Correct Answer: C) 14. 6. Can Python be used for web development? A) Yes, but only for mobile app development. B) Yes, Python can be used for web development. C) No, Python is only for data analysis. D) No, Python cannot be used for any programming. Show Answer Correct Answer: B) Yes, Python can be used for web development. 7. How do you add a comment to Python code? A) Use the # symbol. B) Use the // symbol. C) Use the /* */ symbols. D) None of the above. Show Answer Correct Answer: A) Use the # symbol. 8. What is the main purpose of using Python programming language? A) Simplicity, readability, and versatility. B) Complexity, unreadability, and limited functionality. C) Difficulty, ambiguity, and inflexibility. D) Complication, obscurity, and narrowness. Show Answer Correct Answer: A) Simplicity, readability, and versatility. 9. How do you make the drawing canvas bigger in the turtle graphics library? A) Turtle.Screen(). B) Turtle.screensize(, ). C) Turtle.setup(, ). D) Turtle.mode(). Show Answer Correct Answer: B) Turtle.screensize(, ). 10. Who is the creator of Python programming language? A) Guido Van Rossum. B) James Gosling. C) Ross Ihaka. D) Dennis Ritchie. Show Answer Correct Answer: A) Guido Van Rossum. 11. ..... are data items that have a fixed value A) Tokens. B) Literals. C) Operators. D) Keyword. Show Answer Correct Answer: B) Literals. 12. What will be the output of the following code? "'pythonlength = 5unit = "metre"print(length, unit) "' A) Length unit. B) "5 metre". C) 5metre. D) 5 metre. Show Answer Correct Answer: D) 5 metre. 13. What is the purpose of a code editor in an Integrated Development Environment (IDE)? A) To write and edit code. B) To debug code. C) To compile code. D) To run code. Show Answer Correct Answer: A) To write and edit code. 14. Which of these is a correct comment in Python? A) // This is fun. B) ** This is fun. C) This is fun. D) # This is fun. Show Answer Correct Answer: D) # This is fun. 15. Which of the following is an example of a variable in Python? A) Print("hello"). B) Input("Enter your age"). C) Type(). D) Age=13. Show Answer Correct Answer: D) Age=13. 16. Python supports variable number of parameters. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 17. What type of error is returned by the following statement? print(eval(13)) A) TypeError. B) No Error in this statement. C) SyntaxError. D) ValueError. Show Answer Correct Answer: A) TypeError. 18. Machine code uses the binary number system. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 19. What does the input() function allow a user to do? A) Create variables. B) Output information. C) Print variables. D) Input information into a programme. Show Answer Correct Answer: D) Input information into a programme. 20. What is the correct syntax to print the text 'Hello, World!' in Python? A) Print(Hello, World!). B) Print('Hello, World!'). C) Print "Hello, World!". D) Echo 'Hello, World!" '. Show Answer Correct Answer: B) Print('Hello, World!'). 21. Given t = ("red", "blue", "blue", "green"). What does t.index("blue") return? A) 2 because second occurrence index. B) 1 because first occurrence index. C) 0 because first item matches. D) 3 because length minus one. Show Answer Correct Answer: B) 1 because first occurrence index. 22. A computer ..... is a detailed, step-by-step set of instructions telling a computer exactly what to do. A) Algorithm. B) Function. C) Program. D) Language. Show Answer Correct Answer: C) Program. 23. Debugging is the process of ..... A) Changing the code in the program. B) Identifying and removing errors from a program. C) Adding more code to the program. D) None of the above. Show Answer Correct Answer: B) Identifying and removing errors from a program. 24. Look at the code snippet:fruits = ("apple", "banana", "cherry"); print(len(fruits)). What is printed? A) It prints 1 item. B) It prints 4 items. C) It prints 2 items. D) It prints 3 items. Show Answer Correct Answer: D) It prints 3 items. 25. What version of Python are we learning this year? A) Version 2. B) Version 3. C) Version 4. D) None of the above. Show Answer Correct Answer: B) Version 3. 26. What will be the output of the following code?print("Hello", "World", sep="-") A) Hello World. B) Hello, World. C) HelloWorld. D) Hello-World. Show Answer Correct Answer: D) Hello-World. 27. A = 10b=5b=a+5print(b)What would be printed to the screen in this example? A) 105. B) 10. C) 5. D) 15. Show Answer Correct Answer: D) 15. 28. Which of the following is an example of Python's uses and application? A) Value and Marketing. B) Business and Enterprise. C) Traffic System. D) Online Shopping. Show Answer Correct Answer: B) Business and Enterprise. 29. How do you concatenate two strings in Python? A) Use the '&' operator to combine strings. B) Use the '*' operator to concatenate strings. C) Use the 'concat()' method to join strings. D) Use the '+' operator to concatenate strings. Show Answer Correct Answer: D) Use the '+' operator to concatenate strings. 30. What is NumPy used for? A) Data visualization and plotting. B) Numerical data analysis and scientific computing. C) Web development and design. D) Database management and querying. Show Answer Correct Answer: B) Numerical data analysis and scientific computing. 31. What are the two types of IDLE mode in Python? A) Interactive mode and Script mode. B) Command line and GUI mode. C) Text mode and Graphical mode. D) Debug mode and Release mode. Show Answer Correct Answer: A) Interactive mode and Script mode. 32. The instructions in an algorithm ..... A) Can only be expressed using a programming language. B) Can be expressed in any language. C) Can only be expressed using binary digits. D) Can be expressed in any language, as long as they are precise. Show Answer Correct Answer: D) Can be expressed in any language, as long as they are precise. 33. What is Flask used for? A) Flask is used for creating mobile applications. B) Flask is used for developing web applications in Python. C) Flask is a game development framework. D) Flask is a database management tool. Show Answer Correct Answer: B) Flask is used for developing web applications in Python. 34. Which approach best handles sorting when duplicates exist in a tuple? A) Use sort on tuple to place duplicates last. B) Reverse tuple and rely on stable ordering. C) Convert to set to remove duplicates before sort. D) Use sorted to return list including duplicates. Show Answer Correct Answer: D) Use sorted to return list including duplicates. 35. What is the word (command) used to display numbers and text on the screen? A) Print. B) Display. C) Show. D) Output. Show Answer Correct Answer: A) Print. 36. What is the purpose of the 'len()' function? A) The 'len()' function converts an object to a string. B) The 'len()' function returns the number of items in an object. C) The 'len()' function calculates the sum of numbers in a list. D) The 'len()' function checks if an object is empty or not. Show Answer Correct Answer: B) The 'len()' function returns the number of items in an object. 37. Which of the following is NOT a way to do math in Python? A) 10-2. B) 10 + 2. C) 10 X 2. D) 10 / 2. E) 10 * 2. Show Answer Correct Answer: C) 10 X 2. 38. What is a lambda function? A) A lambda function is a named function defined with a specific syntax. B) A lambda function is a built-in function for data manipulation. C) A lambda function is a type of variable used in programming. D) A lambda function is an anonymous function defined using the lambda keyword. Show Answer Correct Answer: D) A lambda function is an anonymous function defined using the lambda keyword. 39. Which of the following is necessary before writing a Python program? A) Installation. B) Data Types. C) Loops. D) Functions. Show Answer Correct Answer: A) Installation. 40. Print(a, b)b = 64a = 6When this program is executed, what will be displayed on the screen? A) 64 6. B) 6 64. C) There is an error in the program because variables a and b are not assigned values in the right order. D) There is an error in the program because when line 1 is executed, variables a and b have not been assigned values. Show Answer Correct Answer: D) There is an error in the program because when line 1 is executed, variables a and b have not been assigned values. 41. Which of the following is NOT an application of Python? A) Making a splash in water. B) Web development. C) Data analysis. D) Game programming. Show Answer Correct Answer: A) Making a splash in water. 42. Which of the following is a correct way to assign a value to a variable in Python? A) Declare x = 5. B) X = 5. C) Int x = 5. D) Var x = 5. Show Answer Correct Answer: B) X = 5. 43. Which of the following is a valid way to declare a variable in Python? A) Let length = 10. B) Length = 10. C) Length:= 10. D) Var length = 10. Show Answer Correct Answer: B) Length = 10. 44. Which of the following statement will return error when x = 7? A) Print(eval(x)). B) Print(int(x)). C) None of the above. D) Print(x). Show Answer Correct Answer: A) Print(eval(x)). 45. What is the primary purpose of Python in real-world applications? A) Data Analysis. B) Game Development. C) Web Development. D) All of the above. Show Answer Correct Answer: D) All of the above. 46. What does an 'if' statement do in Python? A) Repeats code a set number of times. B) Draws shapes on the screen. C) Runs code only when a condition is True. D) Stores text in a variable. Show Answer Correct Answer: C) Runs code only when a condition is True. 47. Which of the following best describes Python's syntax? A) Complex and verbose. B) Simple and readable. C) Rigid and difficult. D) Obscure and cryptic. Show Answer Correct Answer: B) Simple and readable. 48. Which data type would be most suitable for storing a collection of items of different types? A) Boolean. B) List. C) String. D) Integer. Show Answer Correct Answer: B) List. 49. Bagaimana cara menambahkan komentar di Python? A) Gunakan '/*' untuk memulai komentar di Python. B) Gunakan '#' untuk menambahkan komentar di Python. C) Gunakan '//' untuk menambahkan komentar di Python. D) Tambahkan komentar menggunakan '/* komentar */' di Python. Show Answer Correct Answer: B) Gunakan '#' untuk menambahkan komentar di Python. 50. What does the 'range()' function do in Python? A) Defines a function. B) Converts data types. C) Generates a list of numbers. D) Creates a loop. Show Answer Correct Answer: C) Generates a list of numbers. 51. What will print(2 ** 3) output? A) 9. B) 5. C) 8. D) 6. Show Answer Correct Answer: C) 8. 52. What is Django primarily used for? A) Django is primarily used for mobile app development. B) Django is primarily used for game development. C) Django is primarily used for desktop software development. D) Django is primarily used for web development. Show Answer Correct Answer: D) Django is primarily used for web development. 53. Which of the following assignment will return an error? A) A = b = c = 89. B) A = 6, b = 8. C) A, b, c = 1, 2, 3. D) None of the above. Show Answer Correct Answer: B) A = 6, b = 8. 54. What function would you use to convert a string to an integer? A) ConvertToInteger(). B) Int(). C) ParseIntString(). D) StrToInt(). Show Answer Correct Answer: B) Int(). 55. How many local and global variables are there in the following Python code?var1=5def fn():var1=2var2=var1+5var1=10fn() A) 2 local, 2 global variables. B) 2 local, 1 global variables. C) 1 local, 1 global variables. D) 1 local, 2 global variables. Show Answer Correct Answer: A) 2 local, 2 global variables. 56. What are floats in Python? A) Numbers greater than 100. B) Numbers with decimal points (Ex:3.2). C) An empty space in your code. D) Even numbers. E) Variables in your code that change value. Show Answer Correct Answer: B) Numbers with decimal points (Ex:3.2). 57. Which of the following is the first step in program development? A) Writing the code. B) Problem analysis. C) Problem design. D) Debugging. Show Answer Correct Answer: B) Problem analysis. 58. The features of Python A) Easy to read, write and learn. B) Used to develop GUI applications. C) Can use OOP. D) All is correct. Show Answer Correct Answer: D) All is correct. 59. To get the users input what function do we use? A) Input. B) Input(). C) INPUT(). D) Input<>. Show Answer Correct Answer: B) Input(). 60. What is the correct way to add comments in Python code? A) Using a double forward slash. B) Using a dollar sign. C) Using a forward slash. D) Using a hash symbol. Show Answer Correct Answer: D) Using a hash symbol. ← 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