🐍
পাইথন বেসিক
  • পরিচিতি
  • ইনস্টলেশন
  • ব্যাসিক কনসেপ্ট
    • পাইথন এর জন্য সেটআপ visual studio code
    • প্রথম প্রোগ্রাম রান করি
    • print ফাংশন
      • প্রিন্ট ফাংশনের প্যারামিটার
    • Comment
      • DocString
      • comment এবং docstring এর পার্থক্য
    • আইডেন্টিফাইয়ারস
  • স্ট্রিং (Strings)
  • ভেরিয়েবল
    • কন্সট্যান্টস (constants)
  • String Formating
  • ব্যবহারকারীর ইনপুট (user input)
  • Python Statement
  • indentation
  • ডেটা টাইপ
    • টাইপ কনভারশন
    • List
  • Python Operator
    • Arithmetic Operators
    • Comparison Operators
    • Logical Operators
    • Identity Operators
    • Membership Operators
    • Assignment Operator
  • Python Flow Control
    • if,else স্টেটমেন্ট
  • ফাংশন
  • ব্যক্তিগত ফাংশন
  • for লুপ
  • while লুপ
  • পাইথন মডিউল (Python module)
    • মডিউল ইম্পোর্ট করা (import Module )
      • Import from another folder
  • পাইথন প্যাকেজ ইনস্টল
  • প্যাকেজ তৈরি
  • এক্সেপশন হ্যান্ডেলিং
  • PIP
  • ফাইল হ্যান্ডেলিং
  • Databse
    • sqlite3
  • PrettyTable
  • Print Coloured Text At Python
Powered by GitBook
On this page

indentation

PreviousPython StatementNextডেটা টাইপ

Last updated 1 year ago

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?

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.

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

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

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.