Free Coding Tutorials: Mastering Python Fundamentals – Part 1

Python Coding Bootcamps

Chapter 1: Introduction

1.1 How to Get Started with Python

Welcome to our comprehensive guide to getting started with Mastering Python Fundamentals – a step-by-step introduction to help you master the basics. Getting started with Python is straightforward, even if you’re new to coding or computers. Follow these step-by-step instructions to install Python on both Windows and Linux.

Installing Python on Windows

  1. Download Python:
  1. Run the Installer:
  • Locate the downloaded file in your Downloads folder and double-click to start the installation.
  • Important: Check the box that says “Add Python to PATH” before clicking “Install Now.”
  1. Verify the Installation:
  • Open Command Prompt by typing cmd in the Start menu.
  • Type python --version and press Enter. You should see the Python version number displayed.

Installing Python on Linux

  1. Open the Terminal:
  • Press Ctrl + Alt + T to open the Terminal.
  1. Update Your System:
  • Type the following command and press Enter:
    bash sudo apt update
  1. Install Python:
  • Install Python by typing:
    bash sudo apt install python3
  1. Install Dependencies:
  • Install pip by typing:
    bash sudo apt install python3-pip
  1. Verify the Installation:
  • Check the Python version by typing:
    bash python3 --version

With Python installed, you’re ready to start coding!

1.2 Your First Program

Now that Python is set up, let’s create your first program.

Step 1: Open Your Text Editor

  • Use a text editor like Notepad on Windows or Gedit on Linux.
  • On Windows, open Notepad by searching for it in the Start menu. On Linux, open Gedit by typing gedit in the Terminal.

Step 2: Write the Code

  • Type the following code in the text editor:
  print("Hello, World!")
  • This simple line of code will display the message “Hello, World!” on your screen.

Step 3: Save the File

  • Save the file as hello_world.py in a location you can easily find.

Step 4: Run the Program

  • On Windows:
  • Open Command Prompt, navigate to the file location using cd, and run the program by typing:
    bash python hello_world.py
  • On Linux:
  • Open Terminal, navigate to the file location using cd, and run the program by typing:
    bash python3 hello_world.py

You should see the message “Hello, World!” displayed on your screen, marking your first step into Python programming!


Read Next :
Free Coding Tutorials: Mastering Python Fundamentals – Part 2 : Variables, Constants and Literals; Type Conversion; Basic Input and Output


Latest Posts