This quiz works best with JavaScript enabled. Home > Cbse > Class 11 > Science > Computer Science > Class 11 Computer Science Chapter 2 Introduction To Python – Quiz 34 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 2 Introduction To Python Quiz 34 (56 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Name two features of Python. A) 1. Simple and readable syntax; 2. Extensive standard library. B) No support for object-oriented programming. C) Limited standard library. D) Complicated and verbose syntax. Show Answer Correct Answer: A) 1. Simple and readable syntax; 2. Extensive standard library. 2. What does the oval shape in a flowchart represent? A) Start and end point. B) Process. C) Input and output. D) Decision. Show Answer Correct Answer: A) Start and end point. 3. What is the result of print(10-3)? A) 7. B) 10-3. C) 3. D) 13. Show Answer Correct Answer: A) 7. 4. How do websites use Python? A) To bake cookies. B) To create web pages. C) To paint walls. D) To sew clothes. Show Answer Correct Answer: B) To create web pages. 5. A collection of items stored in one variable is called: A) List. B) String. C) Integer. D) Keyword. Show Answer Correct Answer: A) List. 6. Which of the following is not key feature of Python? A) Expressive. B) Extensible. C) Easy to use. D) Efficient. Show Answer Correct Answer: D) Efficient. 7. Str() can be used on a number to convert the number to A) A string. B) A variable. C) A floating point number. D) A boolean. Show Answer Correct Answer: A) A string. 8. An expression like 2 + 2 in Python consists of ..... A) Values & Operators. B) Math. C) Variables. D) Commands. Show Answer Correct Answer: A) Values & Operators. 9. What widget would you use to display a single line of text input in Tkinter? A) Button. B) Text. C) Label. D) Entry. Show Answer Correct Answer: D) Entry. 10. Can selenium be used for automation? A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 11. What does the keyword 'if' represent in Python? A) The 'if' keyword is used to declare variables in Python. B) The 'if' keyword is used for defining functions in Python. C) The 'if' keyword represents a conditional statement in Python. D) The 'if' keyword is a loop control statement in Python. Show Answer Correct Answer: C) The 'if' keyword represents a conditional statement in Python. 12. Is this the correct code for a list?register = {"Sam", "Pheobe", Georgia", Richard"} A) Yes. B) No. C) All the above. D) None of the above. Show Answer Correct Answer: B) No. 13. To execute a Python program, you need a Python interpreter. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 14. What will the following code output if the variable 'age' is set to 12? 'print("You are '' + str(age) + '' years old.")' A) You are 12 years old. B) You are "12" years old. C) Error. D) You are age years old. Show Answer Correct Answer: A) You are 12 years old. 15. Which one is the assignment operator? A) +. B) =. C) ==. D) :. Show Answer Correct Answer: B) =. 16. Which keyword is used for function? A) Fun. B) Def. C) Define. D) Function. Show Answer Correct Answer: B) Def. 17. What is the output of the following code? "'pythonprint("The length is", 5, "metres.") "' A) The length is, 5, metres. B) The length is5metres. C) The length is 5 metres. D) The length is 5metres. Show Answer Correct Answer: C) The length is 5 metres. 18. What is the purpose of the pass keyword in Python? A) To define an empty block of code. B) To declare a variable. C) To skip the current iteration. D) To terminate a loop. Show Answer Correct Answer: A) To define an empty block of code. 19. In programming, which word means to break something down into smaller chunks? A) Decompose. B) Remove. C) Slice. D) Chop. Show Answer Correct Answer: A) Decompose. 20. You can check code in the Python A) IDLE. B) N.A. C) Script mode. D) Interactive mode. Show Answer Correct Answer: D) Interactive mode. 21. Which expression converts numbers = (1, 5, 7, 1) into a mutable collection? A) Tuple(numbers) returns a list. B) List(numbers) returns a list. C) Numbers.append(2) returns a list. D) Sorted(numbers, reverse=True) returns a list. Show Answer Correct Answer: B) List(numbers) returns a list. 22. How do you write the number ten as a string in Python? A) Ten. B) 'ten'. C) "10". D) 10. Show Answer Correct Answer: C) "10". 23. Which statement will print the temperature in Celsius entered by the user? A) Print("Temperature in Celsius:'' + str(temp)). B) Print("Temperature in Celsius:'' + str(input())). C) Print("Temperature in Celsius: ", input()). D) Print("Temperature in Celsius:'' + input()). Show Answer Correct Answer: B) Print("Temperature in Celsius:'' + str(input())). 24. Which of the following keywords is used to create an anonymous function in Python? A) Def. B) Anon. C) Lambda. D) Unknown. Show Answer Correct Answer: C) Lambda. 25. For i in range(1, 4):print(i)#end loop A) 1, 2, 3, 4. B) 1, 2, 3end loop. C) Error. D) 1, 2, 3. Show Answer Correct Answer: D) 1, 2, 3. 26. What will be the output of the following code? "'pythonprint("Python"[3]) "' A) Y. B) O. C) H. D) T. Show Answer Correct Answer: C) H. 27. Which statement is used for decision making in Python? A) While. B) Print. C) For. D) If. Show Answer Correct Answer: D) If. 28. Which of the following is true about the while loop? A) Executes at least once. B) Executes until the condition becomes true. C) Executes until the condition becomes false. D) Executes a fixed number of times. Show Answer Correct Answer: C) Executes until the condition becomes false. 29. Which mode of Python Interpreter allows to execute multiple statements saved in a file with extension .py ( can be Module/Script/Program file) A) Interactive Mode. B) Immediate Mode. C) Script Mode. D) Command Mode. Show Answer Correct Answer: C) Script Mode. 30. Which function is used to convert a number or string to an integer in Python? A) Float(). B) Bool(). C) Str(). D) Int(). Show Answer Correct Answer: D) Int(). 31. What is the memory location name known as in Python. When using this high level language? A) Variable. B) Very. C) Float. D) Number. Show Answer Correct Answer: A) Variable. 32. What is the result of the expression 5 + 3 in Python? A) 8. B) 6. C) 9. D) 10. Show Answer Correct Answer: A) 8. 33. What will the following code output? "'pythontemperature = 20if temperature > 25:print("It's hot")else:print("It's cool") "' A) It's cool. B) Nothing. C) Error. D) It's hot. Show Answer Correct Answer: A) It's cool. 34. Which of the following is a correct if statement in Python? A) 'if x = 5:'. B) 'if (x == 5)'. C) 'if x:= 5'. D) 'if x == 5:'. Show Answer Correct Answer: D) 'if x == 5:'. 35. What will happen if you call a function with fewer arguments than required, but no default values are provided? A) Function will ignore the missing arguments. B) Function will give an error message. C) Function will return None. D) Function will set remaining arguments to 0. Show Answer Correct Answer: B) Function will give an error message. 36. Which of the following is a correct way to assign strings with multiple lines in a variable? A) ' lines '. B) '' '' lines '' ". C) '' '' '' lines '' '' ''. D) '' lines ''. Show Answer Correct Answer: C) '' '' '' lines '' '' ''. 37. Write the output of the following code:x=2; y=3; x+y+5; print(x+y) A) 5. B) None of the above. C) 10. D) Error. Show Answer Correct Answer: A) 5. 38. What is keyword? A) Letters on a keyboard. B) A keyboard. C) To help in sentences. D) It is a meaningful word that has a specific task to execute. Show Answer Correct Answer: D) It is a meaningful word that has a specific task to execute. 39. Which of the following is a valid way to create a tuple in Python? A) Tuple = (). B) Tuple = {}. C) Tuple = []. D) Tuple = <>. Show Answer Correct Answer: A) Tuple = (). 40. Which one is a Python keyword? A) Dance. B) Jump. C) Begin. D) If. Show Answer Correct Answer: D) If. 41. Describe the use of the 'continue' statement in a loop. A) The 'continue' statement skips the current iteration of a loop and continues with the next iteration. B) The 'continue' statement repeats the current iteration of the loop. C) The 'continue' statement pauses the loop for a specified time. D) The 'continue' statement terminates the loop immediately. Show Answer Correct Answer: A) The 'continue' statement skips the current iteration of a loop and continues with the next iteration. 42. How is Jython different from CPython? A) Jython is written in RPython. B) Jython is written in Java. C) Jython is not compatible with Python 3. D) Jython is a microcontroller-specific implementation. Show Answer Correct Answer: B) Jython is written in Java. 43. What's the output of the below code snippet?from math import sqrtL1 = [x**2 for x in range(10)].pop()L1 += 19print(sqrt(L1), end = '' ")L1 = [x**2 for x in reversed(range(10))].pop()L1 += 16print(int(sqrt(L1))) A) 10.0 4. B) 4.35 4. C) 10 4. D) None of the above. Show Answer Correct Answer: A) 10.0 4. 44. Apa output dari print(2 ** 3)? A) 6. B) 4. C) 9. D) 8. Show Answer Correct Answer: D) 8. 45. What is the data type of x after the following statement?x = [7, 8, 9, 10] A) Set. B) Dictionary. C) Tuple. D) List. Show Answer Correct Answer: D) List. 46. What is the default mode for the PLS turtle when it is created? A) Logo. B) Standard. C) Extended. D) Simple. Show Answer Correct Answer: B) Standard. 47. Which function gives the length of a list? A) Length(). B) Count(). C) Size(). D) Len(). Show Answer Correct Answer: D) Len(). 48. What is the syntax used to ask something in Python? A) Ask(). B) Prompt(). C) Print(). D) Input(). Show Answer Correct Answer: D) Input(). 49. Which of the following statements will display the value stored in the variable 'height'? A) 'print(height)'. B) 'display(height)'. C) 'output(height)'. D) 'show(height)'. Show Answer Correct Answer: A) 'print(height)'. 50. What is the correct rule for naming variables in Python? A) A variable name can contain special characters. B) You can use any Python reserved word as a variable name. C) A variable name cannot start with a number. D) A variable name can contain only numbers and letters. Show Answer Correct Answer: C) A variable name cannot start with a number. 51. Each line or instruction typed is interpreted and executed immediately and results are displayed each time you press ENTER. A) Interactive mode. B) Script mode. C) Sandbox. D) Interpreter. Show Answer Correct Answer: A) Interactive mode. 52. Python is widely used in which specialized field due to its powerful libraries like Pandas and NumPy? A) Video Game Console Manufacturing. B) Advanced Rocket Propulsion Design. C) Data Science and Machine Learning. D) Operating System Kernel Development. Show Answer Correct Answer: C) Data Science and Machine Learning. 53. What is the output of the code:d1 = {"john":40, "peter":45} d2 = {"john":466, "peter":45} print d1 > d2 A) True. B) False. C) Not applicable. D) None of the above. Show Answer Correct Answer: B) False. 54. Which of these is a Python keyword? A) Banana. B) Def. C) Hello. D) Cool. Show Answer Correct Answer: B) Def. 55. Python uses ..... to convert its instructions into machine language. A) None of the above. B) Both of the above. C) Compiler. D) Interpreter. Show Answer Correct Answer: D) Interpreter. 56. What does the turtle.done() function do? A) Initializes the turtle graphics library. B) Closes the turtle window immediately. C) Changes the turtle mode to "logo". D) Keeps the turtle window open until closed with the exit cross. Show Answer Correct Answer: D) Keeps the turtle window open until closed with the exit cross. ← PreviousRelated 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