Python Interview questions - decorators
(Python version 3.9 or later version)
Which of the following Python objects is immutable?
set
dict
list
str
Explanation
Please click here for explanation
What would be the result of executing the following code?
print
(
True
*
2
)
TrueTrue
True True
2
Syntax Error
Explanation
Please click here for explanation
Python Interview Questions
Python - Decorators
1. Decorator used to define a static method?
A) @staticmethod
B) @static
C) @static.method
Answer: @staticmethod