This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 15 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 15 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is a syntax error in Python? A) An error that occurs when a variable is not defined. B) An error that occurs when the code does not follow the correct structure. C) An error that occurs when a file is not found. D) An error that occurs when a function is not called. Show Answer Correct Answer: B) An error that occurs when the code does not follow the correct structure. 2. What is an if statement in Python? A) An if statement in Python is a control structure that executes a block of code if a specified condition is true. B) An if statement in Python is a type of loop. C) An if statement is a way to declare variables in Python. D) An if statement is used to define a function in Python. Show Answer Correct Answer: A) An if statement in Python is a control structure that executes a block of code if a specified condition is true. 3. Which of the following is a valid string in Python? A) "Hello". B) [Hello]. C) \{Hello\}. D) All of the above. Show Answer Correct Answer: A) "Hello". 4. What is the result of 10 % 3? A) 1. B) 3. C) 0. D) 10. Show Answer Correct Answer: A) 1. 5. What will print(10 // 3) output? A) 3. B) 3.3. C) 4. D) 1. Show Answer Correct Answer: A) 3. 6. Input() function takes the input from the user and always returns it as a: A) List. B) Tuple. C) Number. D) String. Show Answer Correct Answer: D) String. 7. What is the result of the expression 10-4 in Python? A) 6. B) 5. C) 4. D) 7. Show Answer Correct Answer: A) 6. 8. Which is the correct syntax? A) Has dog = true. B) Has dog = True. C) Has dog = Treu. D) HAS DOG = tRue. Show Answer Correct Answer: B) Has dog = True. 9. What does the following code do? myAge = int (myAge) A) Converts the var (variable) myAge to a string. B) Converts the var (variable) myAge to a integer. C) Converts the var (variable) myAge from a integer to a string. D) Converts the var (variable) myAge to if statement. Show Answer Correct Answer: B) Converts the var (variable) myAge to a integer. 10. What is the value of 'result' after the following code is executed? "'pythonresult = 15-4 "' A) 19. B) 11. C) 9. D) 7. Show Answer Correct Answer: B) 11. 11. The term which describes errors in a programme which are due to the programmers algorithm and calculations being wrong A) Syntax. B) Syntax error. C) Logic error. D) Bug. E) Debug. Show Answer Correct Answer: C) Logic error. 12. What symbol is used to join (concatenate) variables in Python? A) *. B) -. C) /. D) +. Show Answer Correct Answer: D) +. 13. Read the Python program below:print(a, b)b = 42a = 13When this program is executed, what will be displayed on the screen? A) 13 42. B) 42 13. 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. 14. Which of the following statements about variables in Python is TRUE? A) Variable names can start with a number. B) Variable names can contain spaces. C) Variable names are case-sensitive. D) Variable names must always be written in capital letters. Show Answer Correct Answer: C) Variable names are case-sensitive. 15. What is the backdrop area called in Scratch? A) Ground. B) Paint. C) Area. D) Stage. Show Answer Correct Answer: D) Stage. 16. After converting a tuple to a list for editing, which operation is appropriate before restoring immutability? A) Use list.append on the tuple. B) Use tuple.pop to delete last item. C) Use remove to delete specific items. D) Use count to change values. Show Answer Correct Answer: C) Use remove to delete specific items. 17. What are syntax errors in programming? A) Errors in the logic of a program. B) Errors in the execution of a program. C) Errors in the translation of a program. D) Errors in the display of messages. Show Answer Correct Answer: C) Errors in the translation of a program. 18. What is a string in programming? A) A number data type. B) A data type that represents text enclosed in quotation marks. C) A type of error. D) A type of loop. Show Answer Correct Answer: B) A data type that represents text enclosed in quotation marks. 19. The term which describes identifying errors in a programme and fixing them A) Syntax. B) Syntax error. C) Logic error. D) Bug. E) Debug. Show Answer Correct Answer: E) Debug. 20. What is a program in computer science? A) A set of precise instructions. B) A programming language. C) A machine that executes instructions. D) A problem-solving method. Show Answer Correct Answer: A) A set of precise instructions. 21. What happens if you use else with a for loop? A) Executes when the loop is finished without a break. B) Executes when the loop ends with a break. C) Executes only when the loop condition is true. D) Causes an error. Show Answer Correct Answer: A) Executes when the loop is finished without a break. 22. Which one checks if something is true? A) For. B) If. C) Print. D) Loop. Show Answer Correct Answer: B) If. 23. Which of the following is a method of a list in Python? A) Append(). B) Add(). C) All of the above. D) Insert(). Show Answer Correct Answer: C) All of the above. 24. Which of the following is a Python command word used to indicate we want to work with WHOLE numbers/Integers A) Input. B) Int. C) Float. D) Print. Show Answer Correct Answer: B) Int. 25. What is wrong with this line of code?print("Hi) A) Indentation error. B) Brackets not closed. C) Missing quotation mark. D) Nothing is wrong. Show Answer Correct Answer: C) Missing quotation mark. ← 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