Skip to main content
Foundation

Getting Started

Welcome to our Python 3 tutorial! Whether you're new to programming or looking to expand your skills, Python is an excellent language to learn. In this tutorial, we'll cover the basics of Python 3, the current recommended version. While Python 2 still exists in some legacy codebases, Python 3 is the preferred choice for new projects due to its improvements and ongoing support.

Why Python 3?

Python 3 brings several enhancements over Python 2, including improved Unicode support, better syntax, and various library updates. It's designed to be more intuitive and efficient, making it an excellent choice for beginners and experienced developers alike.

Setting Up Your Environment

To start coding in Python, you need a text editor or an Integrated Development Environment (IDE). For beginners, a simple text editor will do, but as your projects grow, you might want to switch to more feature-rich IDEs like PyCharm, or Visual Studio Code.

Here's how you can set up your environment:

  1. Install Python 3: Visit the official Python website at python.org and download the latest version of Python 3 for your operating system. Follow the installation instructions provided.

  2. Choose a Text Editor or IDE: You can use any text editor like Notepad++ (for Windows), Atom, Sublime Text, or Vim. For a more integrated experience, consider using IDEs like PyCharm, or Visual Studio Code.

  3. Verify Your Installation: Open a terminal or command prompt and type python3 --version to check if Python 3 is installed correctly. You should see the version number displayed.

Writing Your First Python Program

Now that you have your environment set up, let's write a simple Python program. Open your text editor or IDE and follow along:

hello.py
# My First Python Program
print("Hello, Python!")

Save this file with a .py extension, for example, hello.py. Then, open a terminal or command prompt, navigate to the directory where you saved your file, and run the program by typing python3 hello.py. You should see Hello, Python! printed to the console.

🎉 Congratulations! You've written and executed your first Python program.