# First Python program and indentation

# Let's start our first program of Python.

### Example of Python Program by printing "hello\_world"

ubuntu@ip-172-31-44-226:~$ cat python\_first.sh

print ("hello\_world")

ubuntu@ip-172-31-44-226:~$ python3 python\_first.sh

hello world

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686686219132/14d07a88-303e-4408-a682-65f3df6096ae.png align="center")

Unlike in shell, we use echo to display the output

In python we print the value using print syntax like the above image.

print " your message " and execute the Python program.

You can use the command python3 filename.py file extension must be in .py format.

# Indentation in Python

The most important topic to understand is an indentation to write any Python program.

* Whitespace is used for indentation in Python, Python indentation is mandatory.
    

## Role of Indentation in Python

* Like other programming languages such as Java use {} brackets to define a block for indentation. Python use of indentation to highlight the blocks of code.
    

# **Let's see examples where indentation is applied .**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686687329384/cc04d33f-babe-4f9c-9aec-139ed3e2047b.png align="center")

Highlighted with the blue line are indentations and whitespace are called indentation.

The above program has been executed successfully with indentation is maintained throughout the program.

# Let's see an example **and error in case indentation is missed**.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686687643119/25235a1f-77fe-455a-967a-121e306526ce.png align="center")

### Program error out with indentation error.
