Answers for "how to indent a block of code in python"

2

how to indent a block of code in python

# usually use 4 spaces to indent block (don't mix with TABs or IndentationError)
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
Posted by: Guest on May-13-2021

Code answers related to "how to indent a block of code in python"

Python Answers by Framework

Browse Popular Code Answers by Language