Python Questions et reponses d'entretien
Differences associees
Question 51. What are Python Decorators?
Decorator is the most useful tool in Python as it allows programmers to alter the changes in the behavior of class or function.
Question 52. How do we find bugs and statistical problems in Python?
We can detect bugs in python source code using a static analysis tool named PyChecker. Moreover, there is another tool called PyLint that checks whether the Python modules meet their coding standards or not.
Question 53. How do you invoke the Python interpreter for interactive use?
By using python or pythonx.y we can invoke a Python interpreter. where x.y is the version of the Python interpreter.
Question 54. How can Python be an interpreted language?
As in Python the code which we write is not machine-level code before runtime so, this is the reason why Python is called an interpreted language.
Question 55. What happens when a function doesn’t have a return statement? Is this valid?
Yes, this is valid. The function will then return a None object. The end of a function is defined by the block of code that is executed (i.e., the indenting) not by any explicit keyword.
Les plus utiles selon les utilisateurs :
- What is Python?
- How do I share global variables across modules?
- How do you set a global variable in a function in Python?
- What type of language is Python? Programming or Scripting?
- Why can't I use an assignment in an expression?