1.
Install Python
1. Step 1: Visit the Python Website and Navigate to the Downloads Section
(https://www.python.org/downloads/)
2. Step 2: Choose the Python Version
Click on the version you want to download. – Python 3.12.3 (the latest stable
release as of now is Python 3.12.3).
3. Install (Make sure to mark Add Python to PATH )
2. Verify Installation and set PATH
1. Check Installation:
○ Open Command Prompt.
○ Type: python --version
○ You should see the Python version, e.g., Python 3.12.3.
2. Manually Set PATH (if needed):
○ If you can’t see the Python version, locate the Python folder (e.g., C:\Users\
<YourName>\AppData\Local\Programs\Python\Python39).
○ Add this path as follows:
■ Open Environment Variables.
■ In System variables, select Path → Click Edit → New → Add Python's
folder path (e.g., C:\.....\Python39).
Open and Use Python IDLE
3. Interactive Mode.
1. Purpose: Directly execute Python commands and see the output immediately.
2. Where it is: The main window that opens when you open IDLE.
3. Interactive Mode: Type Python commands in the shell.
Example:
print("Hello, World!") and press enter.
4. Script Mode.
1. Purpose: Write and save Python programs in a .py file for reuse.
2. Where it is: Open it by selecting File → New File in IDLE
print("This is Script Mode!")
3. Run the Script:
Press F5 OR Run → Run Module OR Command Prompt: python script.py