Computer Science – Basics of Programming in
Python
Introduction: Programming is the process of designing and building executable computer programs.
Python is one of the most widely used high-level programming languages due to its simplicity and
versatility.
Basic Syntax: Python uses indentation instead of braces. Example: print('Hello, World!')
Variables: Variables are containers for storing data values. Example: x = 10 y = 'Hello'
Data Types: Common types are int, float, string, list, tuple, dict. Example: my_list = [1, 2, 3]
Control Structures: 1. Conditional statements (if, elif, else). 2. Loops (for, while). 3. Break and
continue statements.
Functions: A block of reusable code. Example: def add(a, b): return a + b
Applications of Python: • Web development (Django, Flask). • Data science and AI (NumPy,
Pandas, TensorFlow). • Automation and scripting. • Game development and GUI applications.
Conclusion: Python’s readability, wide library support, and versatility make it an ideal language for
beginners and professionals.