Live AI Powered DevOps with AWS
PythonBasics

First Code


Programming begins with writing instructions that a computer can understand and execute. To work with data, we need to store it, process it, and retrieve it, which requires to write code using a programming language.

Python is a high-level, interpreted language designed to be easy to read and write. The interpreter translates Python code into bytecode and executes it, ultimately running machine-level instructions.

We use programming languages like Python because computers only understand binary (0s and 1s), programming languages provide a human-friendly way to write instructions that get translated into machine code.

Python IDE

How Python Code Runs

To execute Python code, you need two things:

  1. A text editor or IDE – where you write the code
  2. A compiler/interpreter – that converts your code into machine language (binary) so the computer can execute it. The interpreter reads it, converts it to binary internally, and displays the output on the console.

Running First Python Program (Online IDE)

Before installing Python on your computer, you can try writing and running Python code online.

Using OnlineGDB (Online Python Compiler)

Website: https://www.onlinegdb.com/

Steps:

  1. Open the website

  2. Select Python 3 as the programming language

  3. A default template (comments + sample “Hello Python” code) appears

  4. Click Run

  5. The code will be:

    • Compiled into binary
    • Executed
    • Output will appear in the console window

Python IDE

First Code

print("Hello Python")

Output:

Hello Python

Python IDE


What’s Next?

In the next lecture, you will:

  • Install Python
  • Explore a proper IDE (Integrated Development Environment)
  • Start writing Python programs on your computer

Written By: Muskan Garg

How is this guide?

Last updated on