Check your current Python version: `python –version` or `python3 –version`
Download the latest Python installer from the official website: `https://www.python.org/downloads/`
Run the installer and select the option to add Python to PATH
On Windows, choose Upgrade Now if available
On macOS, use the official installer or Homebrew: `brew update && brew upgrade python`
On Linux, use your package manager, for example:
Ubuntu/Debian: `sudo apt update && sudo apt install python3`
Fedora: `sudo dnf upgrade python3`
Arch: `sudo pacman -Syu python`
Verify the update: `python –version` or `python3 –version`
Update pip after upgrading Python: `python -m pip install –upgrade pip`
Reinstall or recreate virtual environments if needed
Update any scripts or PATH settings if they still point to an older Python version
