Python

1. Who developed the Python programming language? TRE 4 based Python Practice set 1 2. Which of the following is the correct extension of a Python file? TRE 4 based Python Practice set 1 3. What will be the output of the following Python program? TRE 4 based Python Practice set 1 4. What will be the output of the following Python program? TRE 4 based Python Practice set 1 5. What will be the output of the following Python program? TRE 4 based Python Practice set 1 6. Which of the following data types is immutable in Python? TRE 4 based Python Practice set 1 7. What will be the output of the following Python program? TRE 4 based Python Practice set 1 8. What will be the output of the following Python program? TRE 4 based Python Practice set 1 9. Which method is used to add an element at the end of a Python list? TRE 4 based Python Practice set 1 10. What will be the output of the following Python program? TRE 4 based Python Practice set 1 11. Which keyword is used to define a function in Python? TRE 4 based Python Practice set 1 12. What will be the output of the following Python program? TRE 4 based Python Practice set 1 13. Which of the following is used to create a dictionary in Python? TRE 4 based Python Practice set 1 14. What will be the output of the following Python program? TRE 4 based Python Practice set 1 15. Which operator is used for exponentiation in Python? TRE 4 based Python Practice set 1 16. What will be the output of the following Python program? TRE 4 based Python Practice set 1 17. Which statement is used to terminate a loop immediately in Python? TRE 4 based Python Practice set 1 18. What will be the output of the following Python program? TRE 4 based Python Practice set 1 19. Which keyword is used to handle exceptions in Python? TRE 4 based Python Practice set 1 20. What will be the output of the following Python program? TRE 4 based Python Practice set 1 21. Which of the following inheritance types is directly supported by Python? TRE 4 based Python Practice set 1 22. What will be the output of the following Python program? TRE 4 based Python Practice set 1 23. Which special method is automatically called when a new object is initialized in a Python class? TRE 4 based Python Practice set 1 24. What will be the output of the following Python program? TRE 4 based Python Practice set 1 25. Which keyword is used to modify a variable from an enclosing function scope in Python? TRE 4 based Python Practice set 1 26. What will be the output of the following Python program? TRE 4 based Python Practice set 1 27. Which module is commonly used to create abstract base classes in Python? TRE 4 based Python Practice set 1 28. What happens when an attempt is made to instantiate an abstract class containing an unimplemented abstract method? TRE 4 based Python Practice set 1 29. What will be the output of the following Python program? TRE 4 based Python Practice set 1 30. Which decorator is used to define a class method in Python? TRE 4 based Python Practice set 1 31. What will be the output of the following Python program? TRE 4 based Python Practice set 1 32. Which of the following statements about Python generators is correct? TRE 4 based Python Practice set 1 33. What will be the output of the following Python program? TRE 4 based Python Practice set 1 34. What will be the output of the following Python program? TRE 4 based Python Practice set 1 35. Which file opening mode creates a new file but raises an error if the file already exists? TRE 4 based Python Practice set 1 36. What is the main purpose of the with statement when working with files in Python? TRE 4 based Python Practice set 1 37. What will be the output of the following Python program? TRE 4 based Python Practice set 1 38. Which of the following statements about Python memory management is correct? TRE 4 based Python Practice set 1 39. What will be the output of the following Python program? TRE 4 based Python Practice set 1 40. What is the correct statement about the __del__() method in Python? TRE 4 based Python Practice set 1 41. Which feature of Python makes it suitable for structured programming? TRE 4 based Python Practice set 1 42. Which language is primarily used to define the structure and content of web pages displayed by a browser? TRE 4 based Python Practice set 1 43. Which of the following statements is correct about the execution of Python programs? TRE 4 based Python Practice set 1 44. Which of the following is NOT a valid Python identifier? TRE 4 based Python Practice set 1 45. What error occurs when a colon is omitted after an if statement in Python? TRE 4 based Python Practice set 1 46. Which shortcut key is commonly used to run a Python script in IDLE? TRE 4 based Python Practice set 1 47. Which file extension is commonly used for a compiled Python bytecode file? TRE 4 based Python Practice set 1 48. What will happen when the following Python statement is executed? TRE 4 based Python Practice set 1 49. Which of the following correctly creates a list containing ten zeros in Python? TRE 4 based Python Practice set 1 50. What will be the output of the following Python program? TRE 4 based Python Practice set 1 51. What is the default accessibility of attributes in a Python class? TRE 4 based Python Practice set 1 52. What happens when a file is opened using the w mode in Python? TRE 4 based Python Practice set 1 53. Which of the following statements about Python file opening modes is correct? I. r is used for reading. II. w is used for writing and truncating. III. a is used for appending. TRE 4 based Python Practice set 1 54. Which of the following is a correct Python function definition using type annotations? TRE 4 based Python Practice set 1 55. What will be the output of the following Python program? TRE 4 based Python Practice set 1 56. Which of the following is the correct syntax for inheritance in Python? TRE 4 based Python Practice set 1 57. Which built-in function is used to check whether an object belongs to a particular class or its subclass? TRE 4 based Python Practice set 1 58. Which of the following statements correctly describes the relationship between a class and an object in Python? TRE 4 based Python Practice set 1 59. Which of the following features of Python allows the same operation to behave differently for different object types? TRE 4 based Python Practice set 1 60. Which OOP features are demonstrated by the following Python code? TRE 4 based Python Practice set 1 61. What will be the output of len("BPSC") in Python? TRE 4 based Python Practice set 1 62. Which string method converts all characters into lowercase? TRE 4 based Python Practice set 1 63. What will be the output of the following Python statement? TRE 4 based Python Practice set 1 64. What will be the output of the following Python statement? TRE 4 based Python Practice set 1 65. What will be the output of the following list comprehension? TRE 4 based Python Practice set 1 66. Which is the correct syntax for creating a tuple containing only one element? TRE 4 based Python Practice set 1 67. What will be the values of a and b after executing the following statement? TRE 4 based Python Practice set 1 68. What does get() return when a dictionary key is missing and no default value is supplied? TRE 4 based Python Practice set 1 69. Which method returns a view containing all keys of a Python dictionary? TRE 4 based Python Practice set 1 70. What will be the output of the following Python program? TRE 4 based Python Practice set 1 71. Which operator checks whether an element exists in a sequence? TRE 4 based Python Practice set 1 72. What will be the output of the following Python expression? TRE 4 based Python Practice set 1 73. What will be the result of the following Python expression? TRE 4 based Python Practice set 1 74. What will be the output of the following Python expression? TRE 4 based Python Practice set 1 75. Which is the correct syntax of a conditional expression in Python? TRE 4 based Python Practice set 1 76. How many times will print execute in the following program? TRE 4 based Python Practice set 1 77. What will be the output of the following Python statement? TRE 4 based Python Practice set 1 78. What will be the output of the following Python program? TRE 4 based Python Practice set 1 79. What will be the output of the following Python statement? TRE 4 based Python Practice set 1 80. What will be the output of the following Python statement? TRE 4 based Python Practice set 1