python indentation fixer code example

Example 1: python indentation

# usually use 4 spaces to indent (don't mix with TABs)
j = 1
site = 'cg'
while(j<= 1):
    if site == 'cg': 
        print('okay') 
    else: 
        print('retry') 
    j += 1
    print ('j: ' + str(j))
print('Done') 					# okay          j: 2        Done

Example 2: indentation in python

Indentation in Python refers to the (spaces and tabs) that are used at the beginning of a statement.

Example 3: python linter online

sudo apt-get install pylint

Example 4: online python formatter and compiler

12345678910111213141516171819class BaseConnection:    def _init_(self, credentials):        self.rs_connection = RedshiftConnection(credentials)    def set_timeout(self, timeout=10):        self.rs_connection.timeout = timeout        class MyDBConnection(BaseConnection):    def _init_(self, credentials):        self.rs_connection = RedshiftConnection(credentials)        super.__init__(self, credentials)            def set_timeout(self, timeout=20):        self.rs_connection.timeout = timeoutcredentials = {'username': 'user1', 'password': 'pass1'}my_db_conn = MyDBConnection(credentials)my_db_conn.set_timeout()print(my_db_conn.rs_connection.timeout)X