This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 11 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 11 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is an algorithm? A) Coding mistakes. B) A list of rules to follow in order to solve a problem. C) Finding mistakes and getting rid of them. D) Data values that can change. Show Answer Correct Answer: B) A list of rules to follow in order to solve a problem. 2. What is the output of the following code? x = 2 x = x * x print(x) A) 2. B) 8. C) 0. D) 4. Show Answer Correct Answer: D) 4. 3. In Python a list with no elements like this [] is also called: A) None list. B) Zero list. C) False list. D) Empty list. Show Answer Correct Answer: D) Empty list. 4. Pick the Python command used to let the user type in some data A) Int. B) Input. C) Float. D) Get. Show Answer Correct Answer: B) Input. 5. Print( "Mypython" *3) A) Mypython*3. B) Mypython*3Mypython*3Mypython*3. C) MypythonMypythonMypython. D) None of the above. Show Answer Correct Answer: C) MypythonMypythonMypython. 6. A statement is ..... A) A part of an algorithm. B) A complete computer command. C) A solution to a problem. D) A translation of machine language. Show Answer Correct Answer: B) A complete computer command. 7. How do you immediately exit a loop in Python? A) Stop. B) Exit. C) Return. D) Break. Show Answer Correct Answer: D) Break. 8. Read the Python program below:print("Enter a number")number = int(input())if number > 0:print(number, "is positive")else:print(number, "is negative")When this program is executed, what will be displayed on the screen if the user enters 0 at the prompt? A) 0 is negative. B) The program will not display anything because 0 is neither positive nor negative. C) 0 is positive0 is negative. D) 0 is positive. Show Answer Correct Answer: A) 0 is negative. 9. What must you use at the end of an if line in Python? A) A colon:. B) A comma,. C) A semicolon ;. D) A period . Show Answer Correct Answer: A) A colon:. 10. Python was created by: A) Mark Zuckerberg. B) Elon Musk. C) Bill Gates. D) Guido van Rossum. Show Answer Correct Answer: D) Guido van Rossum. 11. What are algorithms? A) Step-by-step instructions for solving problems. B) The process of representing numbers and text in binary. C) The study of computers and computing technologies. D) The use of electricity to represent binary digits. Show Answer Correct Answer: A) Step-by-step instructions for solving problems. 12. A data type that can only be one of two values:True or False A) Boolean. B) String. C) Integer. D) Float. Show Answer Correct Answer: A) Boolean. 13. What is the correct syntax to output "Hello, World" in Python? A) Printf("Hello, World"). B) Print("Hello, World"). C) Echo "Hello, World". D) Cout << "Hello, World". Show Answer Correct Answer: B) Print("Hello, World"). 14. Which of the following data types is NOT supported in Python? A) String. B) Float. C) Integer. D) Character. Show Answer Correct Answer: D) Character. 15. What type of programming paradigms does Python support? A) Procedural. B) Object-oriented. C) Functional. D) All of the above. Show Answer Correct Answer: D) All of the above. 16. What will happen if you try to print a variable that hasn't been defined? A) An error will occur. B) It will print None. C) It will print an empty string. D) None of the above. Show Answer Correct Answer: A) An error will occur. 17. Which command is used to read every line from a file one at a time in Python? A) For in:. B) .writelines(). C) .close(). D) .readline(). Show Answer Correct Answer: A) For in:. 18. Which of the following is a string data type in Python? A) '3.5'. B) '25'. C) 'True'. D) '"London"'. Show Answer Correct Answer: D) '"London"'. 19. If first ..... name = "Kevin" and last ..... name = "Drumm", which line joins them with a space? A) Print(first name, last name). B) Print(first name + last name). C) Print(first name + '' '' + last name). D) Print("first name" + "last name"). Show Answer Correct Answer: C) Print(first name + '' '' + last name). 20. What is the output of the following code?print("The temperature is", 25, "degrees Celsius.") A) The temperature is 25 degrees Celsius. B) The temperature is 25 degrees Celsius. C) The temperature is 25degrees Celsius. D) The temperature is25 degrees Celsius. Show Answer Correct Answer: A) The temperature is 25 degrees Celsius. 21. Matplotlib digunakan untuk ..... A) Membersihkan data. B) Membuat visualisasi data. C) Melatih model prediksi. D) Menyimpan data. Show Answer Correct Answer: B) Membuat visualisasi data. 22. Escape sequence is represented by a ..... followed by one or more characters A) Single Quote. B) Back Slash. C) Front slash. D) Double Quote. Show Answer Correct Answer: B) Back Slash. 23. Python is ..... level programming language and is ..... A) Low, interpreted. B) Low, compiled. C) High, compiled. D) High, interpreted. Show Answer Correct Answer: D) High, interpreted. 24. What is the correct syntax to define a multi-line string in Python? A) [[This is a multiline string]]. B) """This is a multiline string""". C) 'This is a multiline string'. D) "This is a multiline string". Show Answer Correct Answer: B) """This is a multiline string""". 25. What does IDE stand for? A) Interactive Development Language. B) Integrated Development Environment. C) Interactive Development Environment. D) Integrated Data Language. Show Answer Correct Answer: B) Integrated Development Environment. 26. If you want to store the value 3.14 in a variable called 'pi', which data type will Python use? A) Boolean. B) Float. C) Integer. D) String. Show Answer Correct Answer: B) Float. 27. Print("Enter a number")number = int(input())if number = 0:print(number, "is zero")else:print(number, "is non-zero")When this program is executed, what will be displayed on the screen, if the user enters 0 at the prompt? A) 0 is non-zero. B) 0 is zero0 is non-zero. C) 0 is zero. D) There is a syntax error in the condition in line 3. Show Answer Correct Answer: D) There is a syntax error in the condition in line 3. 28. Id() function is used to get A) The variable's address in the memory. B) The information about the variable's value. C) The datatype of a varaible. D) Value to which a variable is bound. Show Answer Correct Answer: A) The variable's address in the memory. 29. Which statement is TRUE about variables? A) A variable can never change. B) A variable stores data and its value can change while a program runs. C) A variable must always store a sentence. D) A variable is the same as print(). Show Answer Correct Answer: B) A variable stores data and its value can change while a program runs. 30. Let a = ("apple", "banana") and b = ("cherry", ). Which result comes from a + b? A) ("apple", ) without change. B) ("apple", "cherry", "banana"). C) ("banana", "cherry") only. D) ("apple", "banana", "cherry"). Show Answer Correct Answer: D) ("apple", "banana", "cherry"). 31. What does the print() function do in Python? A) The print() function performs mathematical calculations. B) The print() function reads input from the user. C) The print() function displays output to the console. D) The print() function saves data to a file. Show Answer Correct Answer: C) The print() function displays output to the console. 32. Which library must be imported to use the sqrt() function? A) Numpy. B) Statistics. C) Random. D) Math. Show Answer Correct Answer: D) Math. 33. What is the output of the expression 8 // 3? A) 3. B) 2. C) 2.67. D) 3.0. Show Answer Correct Answer: B) 2. 34. How do you convert a string to an integer in Python? A) Int('string'). B) String.to int(). C) Str('string'). D) Convert('string'). Show Answer Correct Answer: A) Int('string'). 35. What will be the output of the following code?if 5 > 3:print("Yes") A) False. B) Yes. C) True. D) No. Show Answer Correct Answer: B) Yes. 36. What command is used to print text to the screen? A) Show(). B) Print(). C) Output(). D) Input(). Show Answer Correct Answer: B) Print(). 37. What is the output of the expression 10 / 2? A) 5. B) 2. C) 10. D) 20. Show Answer Correct Answer: A) 5. 38. How is a block of code defined in Python? A) With indentation. B) With paranthesis. C) With curly braces. D) None of the above. Show Answer Correct Answer: A) With indentation. 39. What is the index of the first element in a Python list? A) 1. B) 0. C) -1. D) None. Show Answer Correct Answer: B) 0. 40. What is Python named after? A) A really big tropical snake. B) Monty Python & the Flying Circus. C) Fred Python, the creator. D) An event where people eat lots of pies. Show Answer Correct Answer: B) Monty Python & the Flying Circus. 41. Identifier name can be of maximum ..... character A) Any number of. B) 63. C) 53. D) 79. Show Answer Correct Answer: B) 63. 42. How do you concatenate the strings '"Good"' and '"afternoon"' in Python? A) "Good" . "afternoon". B) "Good" & "afternoon". C) "Good" .concat("afternoon"). D) "Good" + "afternoon". Show Answer Correct Answer: D) "Good" + "afternoon". 43. Which value is a String? A) "cat". B) 0.5. C) 64. D) True. Show Answer Correct Answer: A) "cat". 44. Keyword apa yang digunakan untuk mendefinisikan sebuah fungsi di Python? A) Definisi. B) Def. C) Metode. D) Fungsi. Show Answer Correct Answer: B) Def. 45. The List Data Type, Working with Lists, and Augmented Assignment Operators are covered in which module? A) Module-3. B) Module-4. C) Module-2. D) Module-1. Show Answer Correct Answer: C) Module-2. 46. Which if the following is a disadvantage of Python? A) Compulsory variable declaration before using them. B) Python is not easy to understand. C) Python is slower than compiled programs in cases of large-scale simulations. D) Python is an open-source programming language. Show Answer Correct Answer: C) Python is slower than compiled programs in cases of large-scale simulations. 47. What will be the output of the following lambda function?add = lambda a, b:a + bprint (add (3, 4) ) A) 34. B) Error. C) 7. D) A + b. Show Answer Correct Answer: C) 7. 48. How do you define a floating point number in Python? A) A floating point number can only be defined using binary format. B) A floating point number is defined by using only whole numbers. C) A floating point number is created by adding a percentage sign after the number. D) A floating point number in Python is defined by including a decimal point (e.g., 3.14) or using scientific notation (e.g., 2.5e2). Show Answer Correct Answer: D) A floating point number in Python is defined by including a decimal point (e.g., 3.14) or using scientific notation (e.g., 2.5e2). 49. Which of the following is not a valid way to define this dictionary in Python: A) D = { ('foo', 100), ('bar', 200), ('baz', 300) }. B) D = {'foo':100, 'bar':200, 'baz':300}. C) D = dict([ ('foo', 100), ('bar', 200), ('baz', 300)]). D) D = dict(foo=100, bar=200, baz=300). E) D = {}d['foo'] = 100d['bar'] = 200d['baz'] = 300. Show Answer Correct Answer: A) D = { ('foo', 100), ('bar', 200), ('baz', 300) }. 50. The two major versions of Python are: A) Python 1.x and Python 2.x. B) Python 2.x and Python 3.x. C) Python 3.x and Python 4.x. D) Python 1.x and Python 3.x. Show Answer Correct Answer: B) Python 2.x and Python 3.x. 51. What is the output of the following code? "'pythonx = "Python"y = "Programming"print(x + '' '' + y) "' A) PythonProgramming. B) Python. C) Python Programming. D) Programming. Show Answer Correct Answer: C) Python Programming. 52. A ..... tool creates exact copies of your files to be restored later in case of data loss. A) Backup tool. B) History tool. C) All the above. D) None of the above. Show Answer Correct Answer: A) Backup tool. 53. Stores a piece of data, and gives it a specific name A) Interpreter. B) Variable. C) Whitespace. D) Modulus. Show Answer Correct Answer: B) Variable. 54. Which of the following is not a feature of Python language? A) Python uses indentation for blocks. B) Python supports multiple programming paradigms. C) Python is a proprietary software. D) Python is not case-sensitive. Show Answer Correct Answer: C) Python is a proprietary software. 55. How do you declare a variable in Python? A) Var variable name = value. B) You declare a variable in Python by using the syntax:variable name = value. C) Variable name:value. D) Let variable name = value. Show Answer Correct Answer: B) You declare a variable in Python by using the syntax:variable name = value. 56. What is a notable characteristic of Python code? A) It requires extensive comments. B) It is easy to read. C) It is difficult to debug. D) It is only used for web development. Show Answer Correct Answer: B) It is easy to read. 57. What will be the output of print(type(12.0)) in Python? A) Bool. B) String. C) Int. D) Float. Show Answer Correct Answer: D) Float. 58. Bagaimana cara membuat variabel dalam Python? A) Menggunakan kata kunci var, misalnya var nama = "Budi". B) Menggunakan tanda sama dengan (=), misalnya nama = "Budi". C) Menggunakan tanda titik dua (:), misalnya nama: "Budi". D) Menggunakan tanda tanya (?), misalnya nama? "Budi". Show Answer Correct Answer: B) Menggunakan tanda sama dengan (=), misalnya nama = "Budi". 59. What is the output of:print(3 * 'A')? A) Error. B) A3. C) AAA. D) 3A. Show Answer Correct Answer: C) AAA. 60. ..... method is used to find the data type of a variable. A) Type(). B) Dtype(). C) Typed(). D) None of the above. Show Answer Correct Answer: A) Type(). ← 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