Setting Up Python: Installation and Your First Program.

ADMIN   |    Dec. 4, 2024, 10:51 a.m.
Setting Up Python: Installation and Your First Program

So, you’ve decided to start your coding adventure with Python? 🎉 Fantastic! Now, let’s level up by pairing Python with a sleek, modern, and powerful coding environment: Visual Studio Code (VS Code). Think of it as upgrading from a regular notebook to a digital super-journal for coding. Ready to roll? Let’s get Python and VS Code up and running, and write your very first program!

Step 1: Downloading Python 🐍

First, grab Python from its official lair:

  1. Visit the Official Python Website: Head over to .
  2. Download Python: The site automatically suggests the best version for your system—click the shiny download button.
  3. Save the File: Your browser will download the installer.

Step 2: Installing Python 📦

Now, let’s welcome Python onto your computer.

For Windows Users:

  1. Double-click the installer file.
  2. Important: Check the box that says “Add Python to PATH” (this makes your life much easier).
  3. Click Install Now and let the magic happen.

For Mac Users:

  1. Open the downloaded .pkg file.
  2. Follow the instructions to install Python.
  3. While macOS includes a version of Python, installing the latest ensures compatibility with modern tools.

For Linux Users:

  1. Open a terminal.
  2. Run:

    bash

    Copy code

    sudo apt update   sudo apt install python3  

  3. Python is now installed!

Step 3: Installing VS Code 🖥️

To truly harness the power of Python, let’s set up Visual Studio Code (aka VS Code):

  1. Download VS Code: Head over to the  and grab the installer for your operating system.
  2. Install It: Run the installer and follow the prompts.
  3. Add the Python Extension:
    • Open VS Code.
    • Go to the Extensions view by clicking the Extensions icon on the sidebar or pressing Ctrl+Shift+X (or Cmd+Shift+X on Mac).
    • Search for Python by Microsoft and hit Install.
  4. Done! VS Code is now Python-ready.

Step 4: Testing Your Python Installation 🧪

Before diving into your first program, ensure Python is installed correctly:

  1. Open a terminal (Command Prompt, Terminal, or the integrated terminal in VS Code).
  2. Type:

    bash

    Copy code

    python --version  

    or

    bash

    Copy code

    python3 --version  

  3. If you see a version number, congratulations—you’re ready to code! 🎉

Step 5: Writing Your First Python Program in VS Code ✍️

Now comes the fun part—your first Python program!

  1. Open VS Code.
  2. Create a new file:
    • Click on File > New File or press Ctrl+N (Cmd+N on Mac).
    • Save the file as hello.py (use Ctrl+S or Cmd+S) and ensure it has the .py extension.
  3. Write this code in the file:

    python

    Copy code

    print("Hello, World!")  

Step 6: Running Your Python Program 🚀

Let’s see your code in action!

  1. Open the Integrated Terminal in VS Code:
    • Press Ctrl+ (backtick) or go to View > Terminal.
  2. Run the program:
    • Navigate to the folder where hello.py is saved using the cd command:

      bash

      Copy code

      cd path/to/your/folder  

    • Run your file with:

      bash

      Copy code

      python hello.py  

    • If everything is set up, you’ll see:

      Copy code

      Hello, World!  

      Woohoo! 🎉 You’ve just written and run your first Python program using VS Code.

Why VS Code is Awesome for Python 🦸‍♂️

  • Syntax Highlighting: Makes your code look colorful and easier to read.
  • Autocomplete: Helps you write code faster with suggestions.
  • Integrated Debugging: Fix bugs like a pro.
  • Extensions Galore: Beyond Python, you can customize VS Code for other languages, themes, and tools.

What’s Next? 🔮

Now that Python and VS Code are set up, you’re ready to explore the coding universe. Here are a few ideas to spark your creativity:

  • Write a program to calculate the sum of two numbers.
  • Create a script that greets users by name.
  • Explore Python libraries like Turtle for fun graphics.

Final Thoughts 🐍✨

Setting up Python and VS Code is like equipping yourself with the ultimate coding toolkit. With just a few simple steps, you’re now ready to tackle the world of programming with a powerful language and an equally powerful IDE.

So go ahead, type print("Coding is fun!"), and let the adventure begin. Happy coding, future Pythonista! 🚀

Please Login to Like and Comment !!

Let Us Know How Can We Help You !!

Contact us

Email, call or fillup the form to learn how we can help you

: info@codigoaldea.com

: +91-9730888257