Python_Notes_with_Interview_Questions
Python_Notes_with_Interview_Questions
1. Introduction to Python
Python is a high-level, interpreted programming language known for its readability and
versatility.
Code Example:
print("Hello, World!")
Interview Question:
What are the key features of Python?
Answer:
Python is interpreted, dynamically typed, garbage-collected, supports multiple paradigms,
and has a large standard library.
2. Python Basics
Covers variables, data types, operators, input/output, and basic control structures.
Code Example:
x = 10
y = 20
print("Sum:", x + y)
Interview Question:
What is the difference between list and tuple in Python?
Answer:
Lists are mutable whereas tuples are immutable.
def greet(name):
return f"Hello, {name}"
print(greet("Alice"))
Interview Question:
What is the difference between a module and a package in Python?
Answer:
A module is a single Python file, while a package is a collection of modules in directories
that include a __init__.py file.