Python By INDOMITABLE LIMITEDOctober 13, 2025October 24, 2025 Welcome to your Python Python Which of the following is the correct file extension for Python files? .pyth .py .pt .pyt None Python What is the output of print(type([]))? None Python Which data type is immutable in Python? Set Tuple List Dictionary None Python What does the len() function do? Returns last element Deletes elements Converts to integer Returns number of elements None Python What is the output of 2 ** 3 in Python? 5 9 6 8 None Python How do you write comments in Python? /* comment */ # comment -- comment // comment None Python Which of the following is used to handle exceptions? try-except handle-except error-catch catch-block None Python What is the output of bool(0)? 0 True None False None Python Which method is used to add an element at the end of a list? extend() append() add() insert() None Which module in Python supports regular expressions? pyregex regex re regexp None Python Which statement is used to exit a loop? break exit return stop None Python What is the output of print(5 == 5.0)? Error None True False None Python Which function is used to read input from the user? scan() get() read() input() None Python What is the correct way to open a file for reading in Python? open("file.txt", "x") open("file.txt", "a") open("file.txt", "r") open("file.txt", "w") None Python What is the output of len("Python")? 5 6 7 8 None Python What will be the output of: a = [1, 2, 3] b = a b. append(4) print(a) [1, 2, 3] [1, 2, 3, 4] Error [4, 1, 2, 3] None Python Which of the following statements about Python is TRUE? Python is statically typed Python doesn’t support OOP Python supports multiple inheritance Python code must be compiled before execution None Python What is the difference between is and ==? Both are same is checks equality, == checks type is checks class type only is checks identity, == checks equality None Python What will be the output of print([i for i in range(5) if i % 2 == 0])? [2, 4, 6] [1, 2, 3, 4, 5] [0, 2, 4] [1, 3, 5] None Python What does the @staticmethod decorator do? Makes method access only instance variables Prevents method overriding Allows method to be called without creating an object Automatically calls the constructor None Python Which of the following can be used to handle memory cleanup? del() delete() close() init() None Python Which of the following is TRUE about Python generators? a) b) c) d) They return multiple values using yield They return only one value They are slower than normal functions They use more memory None Python Which of these is a web framework in Python? React Spring Django Flutter None Python What is the difference between deep copy and shallow copy in Python? Deep copy is faster than shallow copy Shallow copy copies only references, deep copy copies objects recursively Deep copy copies only references, shallow copy copies all objects Both copy everything None Python Which of the following statements about Python decorators is TRUE? Decorators are used to modify the behavior of functions or classes Decorators are only used for debugging Decorators can only be used in loops Decorators make functions slower None Time's upTime is Up!