Python Viva Questions
Python Viva Questions
1. What is Python?
Answer: Python is a high-level, interpreted, interactive, and object-oriented
programming language. It is known for its simplicity and readability.
3. What is PEP 8?
Answer: PEP 8 is Python's style guide that provides coding conventions for writing
readable Python code. It covers naming conventions, code layout, and other aspects
of coding style.
16. What is the difference between deep copy and shallow copy?
Answer:
- Shallow copy creates a new object but references the same nested objects
- Deep copy creates a completely independent copy of the object and all its nested
objects
28. What is the difference between class method and static method?
Answer:
- Class methods take cls as first parameter and can access class variables
- Static methods don't take any special first parameter and can't access class
variables