This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 43 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 43 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which of the following keywords is used to create a loop in Python? A) Loop. B) Iterate. C) Repeat. D) For. Show Answer Correct Answer: D) For. 2. What is a loop in Python? A) A loop in Python is a function that returns a value. B) A loop in Python is a data type for storing values. C) A loop in Python is a control structure for repeated execution of code. D) A loop in Python is a method for defining classes. Show Answer Correct Answer: C) A loop in Python is a control structure for repeated execution of code. 3. A CONDITION in Python always evaluates to A) 0 (zero). B) A string. C) A code block. D) True or False. Show Answer Correct Answer: D) True or False. 4. None in Python has which data type? A) False. B) Integer. C) NoneType. D) Does not have one. Show Answer Correct Answer: C) NoneType. 5. Which of the following is NOT a numeric type in Python? A) String. B) Complex. C) Int. D) Float. Show Answer Correct Answer: A) String. 6. Why must programs written in high-level programming languages be converted to machine code? A) Because machine code is easier for humans to read. B) Because computers can only understand machine code in binary. C) Because high-level languages are too complex for computers. D) Because high-level languages are not secure. Show Answer Correct Answer: B) Because computers can only understand machine code in binary. 7. Which keyword starts a conditional in Python? A) Check. B) If. C) Else. D) When. Show Answer Correct Answer: B) If. 8. What is the result of the following code? "'pythonweight = 12print(weight, "kg") "' A) 12 kg. B) Kg 12. C) "weight kg". D) Error. Show Answer Correct Answer: A) 12 kg. 9. In Python, a variable must be declared before it is assigned a value: A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 10. How do you add data in SQL? A) INSERT INTO. B) ADD. C) INSERT NEW. D) ADD RECORD. Show Answer Correct Answer: A) INSERT INTO. 11. How do you access a specific cell in a DataFrame? A) Using the .loc[] method with row and column labels. B) Using the .get() method with row and column indices. C) Using the .cell() method with row and column numbers. D) Using the .select() method with row and column names. Show Answer Correct Answer: A) Using the .loc[] method with row and column labels. 12. Pernyataan if digunakan untuk ..... A) Menyimpan data dalam jumlah yang sangat besar. B) Memeriksa kondisi benar atau salah. C) Menghapus variabel. D) Mengulangi perintah. Show Answer Correct Answer: B) Memeriksa kondisi benar atau salah. 13. What does the string subprogram .isalpha() return? A) True, if all characters are digits. B) True, if all characters are alphabetic, A-Z. C) True, if all characters are uppercase. D) True, if all characters are lowercase. Show Answer Correct Answer: B) True, if all characters are alphabetic, A-Z. 14. Which collection will any() consider truthy? A) [1] non-empty list. B) \{\} empty dict. C) () empty tuple. D) [] empty list. Show Answer Correct Answer: A) [1] non-empty list. 15. What is selection? A) A decision or question where a program can branch out. B) Checking if two variables are equal to each other. C) Choosing an item from a list. D) Printing text to the screen. Show Answer Correct Answer: A) A decision or question where a program can branch out. 16. Which of the following is a correct way to declare a variable in Python? A) X==10. B) Var x = 10. C) X:= 10. D) X = 10. Show Answer Correct Answer: D) X = 10. 17. Is the comparison operator in python A) =. B) ==. C) = *. D) ===. Show Answer Correct Answer: B) ==. 18. What command is used in python to display output? A) PRINT. B) Print. C) Print(). D) Print ("Hello World"). Show Answer Correct Answer: C) Print(). 19. Write the output of the following code:7+2//1**2 > 5+2**2//3 A) Error. B) False. C) None of the above. D) True. Show Answer Correct Answer: D) True. 20. Which of the following are valid identifiers? A) If, else, 2baba, road Y, #size. B) X, abel, road y, 40. C) Print, while, 69ine, road y, 40. D) Import, def, 2baba, road Y, #size. Show Answer Correct Answer: B) X, abel, road y, 40. 21. What language do we use? A) Python. B) Spanish. C) English. D) Computer. Show Answer Correct Answer: A) Python. 22. What is the purpose of the 'def ():' syntax in Python? A) To define a function with parameters. B) To open a file for reading. C) To define a function with no parameters. D) To write a string to a file. Show Answer Correct Answer: C) To define a function with no parameters. 23. What will be the output of the following Python code?d = \{"john":40, "peter":45\}d["john"] A) 40. B) 45. C) "john". D) "peter". Show Answer Correct Answer: A) 40. 24. What is the purpose of the 'type' function in Python? A) To check the data type. B) To create a variable. C) To convert data types. D) To assign datatype. Show Answer Correct Answer: A) To check the data type. 25. What command do we use to tell Python to accept an input? A) Cin. B) Input(). C) Scanf(). D) <>. Show Answer Correct Answer: B) Input(). ← PreviousNext →Related 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 8Class 11 Computer Science Chapter 2 Introduction To Python Quiz 9Class 11 Computer Science Chapter 2 Introduction To Python Quiz 10 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books