1. What is Python?
Python is a high-level, interpreted programming language created by Guido van
Rossum in 1991.
It is designed for readability and is beginner-friendly.
Uses: Web development, data science, AI, automation, etc.
2. Features of Python
1. Easy to Learn: Simple syntax close to English.
2. Interpreted: Executes code line by line, making debugging easy.
3. Dynamically Typed: You don’t need to define variable types.
4. Versatile: Works for small scripts or large applications.
5. Rich Libraries: Prebuilt tools for almost any task (e.g., pandas, numpy).
, 3. Installing Python
1. Download:
Visit python.org and download the latest version for your OS.
2. Install IDE: Use IDLE (comes with Python) or download VS Code/PyCharm for a
better experience.
3. Verify Installation:
Open the terminal/command prompt and type:
Python –version
4. Writing and Running Your First Python Program
Open an editor or Python shell.
,Write the following code:
Print(“Hello, World!”)
Save it as hello.py and run using:
Python hello.py
Output:
Hello, World!
Exercise 1:
Write a Python program that prints:
1. Your full name
2. Your favorite hobby
, Part 2: Python Basics
1. Variables and Data Types
Variables:
Variables are containers for storing data.
You don’t need to declare their type explicitly.
Example:
Name = “Alice” # String
Age = 25 # Integer
Height = 5.6 # Float
Is_student = True # Boolean
Rules for Variable Names:
1. Must start with a letter or underscore (_).