Python 面试题与答案
相关差异对比
问题 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.
问题 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.
问题 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.
问题 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.
问题 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.
用户评价最有帮助的内容:
- 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?