Python Interview Questions (2)
Python Interview Questions (2)
class Stack:
def __init__(self):
self.stack = []
def push(self, item):
self.stack.append(item)
def pop(self):
return self.stack.pop() if self.stack else None
- Method Overloading: Same method name but different parameters (not directly supported in
Python).
- Method Overriding: Child class redefines a method from the parent class.
import pandas as pd
df = pd.read_csv('data.csv')
print(df.head())