This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 57 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 57 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which control structure is used to repeat a block of code multiple times? A) If statement. B) For loop. C) Print statement. D) Input statement. Show Answer Correct Answer: B) For loop. 2. Which of the following will cause an error in Python? A) Print("Hello). B) X = 5. C) Def func():. D) For i in range(5):. Show Answer Correct Answer: A) Print("Hello). 3. What does Find() do in Beautifulsoup. A) Return the requested element as a list from the HTML. B) Finds whether the element is present or not. C) Finds where the element is present. D) None of the above. Show Answer Correct Answer: A) Return the requested element as a list from the HTML. 4. What is the output of print(3.14 * 2) in Python? A) 6.28. B) 7.0. C) 6.0. D) 5.5. Show Answer Correct Answer: A) 6.28. 5. What do you use Python for? A) Watching movies. B) Drawing with crayons. C) Writing programs. D) Listening to music. Show Answer Correct Answer: C) Writing programs. 6. Which of the following will print the string '"The weight is 25 kgs"' using the variable 'weight = 25'? A) Print("The weight is '' + weight + '' kgs"). B) Print(f"The weight is \{weight\} kgs"). C) Print("The weight is \{weight\} kgs"). D) Print("The weight is '' + str(weight) + '' kgs"). Show Answer Correct Answer: B) Print(f"The weight is \{weight\} kgs"). 7. Which keyword is used to start an if statement? A) If. B) When. C) For. D) Else. Show Answer Correct Answer: A) If. 8. What is a dictionary in Python? A) A dictionary is a type of list in Python. B) A dictionary in Python is a collection of key-value pairs. C) A dictionary is a collection of ordered items in Python. D) A dictionary in Python is a single value. Show Answer Correct Answer: B) A dictionary in Python is a collection of key-value pairs. 9. What is the keyword used to define a function in Python? A) 'function'. B) 'def'. C) 'define'. D) 'func'. Show Answer Correct Answer: B) 'def'. 10. How do you remove the value '3' from a list called 'numbers'? A) Numbers.delete(3). B) Numbers.remove(3). C) Numbers.pop(3). D) Numbers.discard(3). Show Answer Correct Answer: B) Numbers.remove(3). 11. How do you take user input and store it in a variable called 'name' in Python 3? A) Name = input("Enter your name: "). B) Name = raw input("Enter your name: "). C) Input(name). D) Name:= input("Enter your name: "). Show Answer Correct Answer: A) Name = input("Enter your name: "). 12. What is the output of print(3 * 'Hi')? A) Hi. B) 3Hi. C) HiHiHi. D) Error. Show Answer Correct Answer: C) HiHiHi. 13. What is the output of the following code:print(f'7 x 3 = \{7 * 3\}')? A) 7 x 3 = 73. B) 7 x 3 = 21. C) 7 x 3 = 30. D) 7 x 3 = 10. Show Answer Correct Answer: B) 7 x 3 = 21. 14. What is the purpose of lesson closure in teaching? A) To summarize key points and reinforce learning. B) To introduce new topics. C) To assign homework. D) To end the class early. Show Answer Correct Answer: A) To summarize key points and reinforce learning. 15. What does 'input()' function do in Python? A) The 'input()' function reads a line from input, converts it to a string, and returns it. B) The 'input()' function reads a file from disk. C) The 'input()' function executes a block of code. D) The 'input()' function generates random numbers. Show Answer Correct Answer: A) The 'input()' function reads a line from input, converts it to a string, and returns it. 16. What is automation? A) A process which occurs automatically. B) A process performed with minimal human assistance. C) Stuff which humans cant do. D) A process which need to be monitored. Show Answer Correct Answer: B) A process performed with minimal human assistance. 17. What is the programming word to rework something to vary the original? A) Remix. B) Remake. C) Redo. D) Re-evaluate. Show Answer Correct Answer: A) Remix. 18. How do you get the length of a string 'sentence'? A) Sentence.length(). B) Len(sentence). C) Length(sentence). D) Sentence.size(). Show Answer Correct Answer: B) Len(sentence). 19. The "Zen of Python" states that readability counts. In Python, which character is used to denote the start of a single-line comment, which helps improve readability? A) //. B) *. C) #. D) . Show Answer Correct Answer: C) #. 20. Which of these is a correct variable name in Python? A) 2number. B) Number 2. C) Number-2. D) Number 2. Show Answer Correct Answer: B) Number 2. 21. The output of the programx = 4x = "Sally"print(x) A) Four. B) Saly. C) Sally. D) None of the above. Show Answer Correct Answer: C) Sally. 22. Salah satu alasan Python populer untuk Data Science adalah karena ..... A) Tidak bisa dijalankan di Windows. B) Memerlukan biaya yang sangan mahal untuk di pakai. C) Mudah dimengerti dan multi-platform. D) Hanya bisa digunakan online. Show Answer Correct Answer: C) Mudah dimengerti dan multi-platform. 23. What is the correct function to take input from a user in Python? A) Get(). B) Input(). C) Read(). D) Scan(). Show Answer Correct Answer: B) Input(). 24. Which of the following is a correct way to name a variable? A) 1st name = Steve. B) First name = Steve. C) First Name = Steve. D) 1st name = Steve. Show Answer Correct Answer: C) First Name = Steve. 25. For the tuple t = (1, 5, 7, 10), which expression returns the largest value? A) Min(t) returns the largest value. B) Sum(t) returns the largest value. C) Max(t) returns the largest value. D) Len(t) returns the largest value. Show Answer Correct Answer: C) Max(t) returns the largest value. ← 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