Module Search Path (Sys.Path)

Mon 10 August 2026
import sys

print(sys.path)
['C:\\Users\\Ashwin\\AppData\\Local\\Programs\\Python\\Python313\\python313.zip', 'C:\\Users\\Ashwin\\AppData\\Local\\Programs\\Python\\Python313\\DLLs', 'C:\\Users\\Ashwin\\AppData\\Local\\Programs\\Python\\Python313\\Lib', 'C:\\Users\\Ashwin\\AppData\\Local\\Programs\\Python\\Python313', '', 'C:\\Users\\Ashwin\\AppData\\Local\\Programs\\Python\\Python313\\Lib …

Category: chapter10_modules_and_packages

Read More

Multilevel Inheritance

Mon 10 August 2026
class Grandparent:
    def feature(self):
        print("Grandparent feature")

class Parent(Grandparent):
    pass

class Child(Parent):
    pass

c = Child()
c.feature()
Grandparent feature


Score: 10

Category: chapter2_inheritance

Read More

Naming And Design Pattern

Mon 10 August 2026
class InvalidOrderStateError(Exception):
    """Raised when an order is in an invalid processing state"""
    pass

def process_order(status):
    if status != "confirmed":
        raise InvalidOrderStateError("Order must be confirmed before processing")

process_order("draft")

Score: 5

Category: chapter14_main_function

Read More
Page 10 of 20

« Prev Next »