Loading notes...
Loading notes...
B.Tech • Chapter 1
B.Tech level module on Introduction to Python & Architecture.
Python is a high-level, interpreted, dynamically-typed programming language. Unlike C or C++, which compile directly to machine code, Python source code is compiled into bytecode and then executed by the Python Virtual Machine (PVM).
Advanced Engineering Concepts
At a B.Tech level, it's crucial to understand memory management. Python uses reference counting and a cyclic garbage collector to manage memory. The Global Interpreter Lock (GIL) is a mutex that protects access to Python objects, preventing multiple native threads from executing Python bytecodes at once.
Code Implementation
import sys
x = 10
# Reference counting example
print(sys.getrefcount(x))
# Dynamic typing
x = "Hello Engineering"
print(type(x))