Python Crash Course 2nd Revision: Stage-1

python Rev2 install

Installing Python

Welcome to the Python Crash Course! In this series, we’ll take you on a journey to learn Python, one of the most popular and versatile programming languages. In this first part, we’ll start with the basics: installing Python on your computer. Whether you’re a beginner or an experienced programmer, Python has something to offer. Let’s get started!

Why Python?

Before we dive into installation, it’s important to understand why Python is worth learning. Python is known for its simplicity and readability, making it an excellent language for beginners. It’s used in web development, data analysis, scientific computing, artificial intelligence, and more. Python’s extensive library ecosystem and active community make it a valuable tool for diverse projects.

Installing Python:

Windows:

For Windows users, follow these steps to install Python:

  • Visit the official Python website at python.org.
  • Click on the “Downloads” tab and select the latest version of Python (e.g., Python 3.9.6).
  • Scroll down and choose the Windows installer that matches your system (either 32-bit or 64-bit).
  • Download the installer and run it.
  • Check the box that says “Add Python 3.x to PATH” during the installation.
  • Click “Install Now” to start the installation process.
macOS:

For macOS users, Python is pre-installed, but it’s a good idea to use a package manager like Homebrew to manage your Python installation:

  • Open Terminal.
  • Install Homebrew (if not already installed) by following the instructions on the Homebrew website.
  • Install Python by running brew install python in the Terminal.
Linux:

Most Linux distributions come with Python pre-installed. To install or update Python, use your package manager. For example, on Debian-based systems, you can use:

sudo apt-get update
sudo apt-get install python3

Verification:

After the installation is complete, open your terminal or command prompt and type python --version or python3 --version to confirm that Python is installed and check the version number.

Writing Your First Program – Hello World:

Now that you have Python installed, let’s write your first Python program. The “Hello World” program is a classic starting point for any programming language. Open your favorite text editor or integrated development environment (IDE) and follow these steps:

  • Open a new file.
  • Type the following code:
print("Hello, World!")
  • Save the file with a .py extension, for example, hello.py

  • Open your terminal or command prompt and navigate to the directory where you saved the file.

  • Run the program by typing python hello.py (or python3 hello.py on some systems).

You should see the text “Hello, World!” displayed on your screen. Congratulations, you’ve written and executed your first Python program!

Coding Environments

There are many integrated development environments (IDE) out there for writing your Python programs or scripts, I personally use Visual Studio on Windows or Thonny on the Raspberry Pi OS. Thonny is great because it comes prepackaged with plenty of Python libraries ready to use. To download and install Visual Studio to your Windows system, go here: Visual Studio Code

Visual Studio can be used for writing code for most languages, it even has an auto-complete feature which can make writing code even faster. If you’re just using it for your own uses and not for enterprise/business needs, you can download the community edition for free.

Conclusion

In this first part of the Python Crash Course, you’ve taken the initial step by installing Python on your computer and writing your first Python program, the “Hello World” program. Now that you have Python up and running, and you’ve experienced your first lines of Python code, you’re ready to start your programming journey. In the upcoming posts, we’ll explore Python’s syntax, data types, and much more. In the next part of our Python crash course, we will be learning about Print Statements and Comments. Stay tuned for more Python goodness!

That’s All Folks!

You can explore more of our Python guides here: Python Guides

Luke Barber

Hello, fellow tech enthusiasts! I'm Luke, a passionate learner and explorer in the vast realms of technology. Welcome to my digital space where I share the insights and adventures gained from my journey into the fascinating worlds of Arduino, Python, Linux, Ethical Hacking, and beyond. Armed with qualifications including CompTIA A+, Sec+, Cisco CCNA, Unix/Linux and Bash Shell Scripting, JavaScript Application Programming, Python Programming and Ethical Hacking, I thrive in the ever-evolving landscape of coding, computers, and networks. As a tech enthusiast, I'm on a mission to simplify the complexities of technology through my blogs, offering a glimpse into the marvels of Arduino, Python, Linux, and Ethical Hacking techniques. Whether you're a fellow coder or a curious mind, I invite you to join me on this journey of continuous learning and discovery.

Leave a Reply

Your email address will not be published. Required fields are marked *

Verified by MonsterInsights