Python Interview Questions – Tanglish + English +
Code
1. What is PEP 8?
Tanglish: PEP 8 na Python coding style guide. Idhu code readable ah, clean ah, professional ah
write panna help pannum. Indentation, variable naming, line length ellam PEP 8 rules la irukum.
English: PEP 8 stands for Python Enhancement Proposal 8. It is the official style guide for writing
Python code, focusing on readability and consistency.
Example:
Correct:
def add_numbers(a, b):
return a + b
Wrong:
def addNumbers(a,b): return a+b
2. What is Pickle?
Tanglish: Pickle na Python object ah file la save pannradhuku use aagum. Later adhe object ah
thirumba load panna mudiyum.
English: Pickle is a Python module used to serialize and deserialize Python objects, which means
converting objects into byte streams and back.
Code Example:
import pickle
data = {'name': 'Kitten', 'age': 20}
with open('[Link]', 'wb') as f:
[Link](data, f)
3. Data Types in NumPy
Tanglish: NumPy la data types efficient ah memory use panna help pannum. int, float, complex,
bool ellam common types.
English: NumPy provides specific data types for numerical computations, which are faster and
memory-efficient compared to Python lists.
Examples:
int32, float64, complex128, bool_
4. Pandas Merge vs Concat
Tanglish: Merge na SQL join madhiri work pannum. Concat na tables ah straight ah attach
pannum.
English: merge() is used for combining DataFrames based on keys or columns, while concat() is
used to stack DataFrames along rows or columns.
Example:
[Link](df1, df2, on='id')
[Link]([df1, df2])
5. Vectorization
Tanglish: Vectorization na loop use pannama full array operations perform pannradhu. Idhu romba
fast ah irukum.
English: Vectorization means performing operations on entire arrays instead of looping element by
element, which improves performance significantly.
Example:
import numpy as np
arr = [Link]([1, 2, 3])
result = arr * 2