# indentation

Many popular languages such as C, and Java uses braces ({ }) to define a block of code, and Python uses indentation.

### What is Indentation in Python?

&#x20;Indentation in Python refers to the whitespaces at the start of the line to indicate a block of code. We can create an indentation using space or tabs. When writing Python code, we have to define a group of statements for functions and loops. This is done by properly indenting the statements for that block.

&#x20;পাইথনে কোড ব্লক বুঝানোর জন্য কোন ব্র‍্যাকেট ব্যবহার করা হয় না৷ তাই ক্লাস বা ফাংশন লিখার সময় কোড ব্লকের শুরু বা শেষ বুঝাতে ইন্ডেন্টেশনের ব্যবহার করা হয়। সাধারণত এক ট্যাব বা চারটি স্পেস কে স্ট্যান্ডার্ড ধরা হয়।

```python
def foo():
    print("Hi")
 
    if True:
        print("true")
    else:
        print("false")
 
print("Done")
```

<figure><img src="https://266499525-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtiINvXcTIgpEyOdCjrwk%2Fuploads%2FUX8UDgWPTQLtswyMKup0%2Fimage.png?alt=media&#x26;token=eff9634c-cde1-4e2e-8cc2-03dc8e1ea711" alt=""><figcaption></figcaption></figure>

**Note:** In Python programming languages the indentation in code can be done by using two spaces or four spaces (or any other number of spaces), you just have to be consistent, although 4 spaces for each level of indentation is the best practice.
