how to indent a block of code in python

Solutions on MaxInterview for how to indent a block of code in python by the best coders in the world

showing results for - "how to indent a block of code in python"
Jakob
08 Apr 2016
1# usually use 4 spaces to indent block (don't mix with TABs or IndentationError)
2j = 1
3site = 'cg'
4while(j<= 1):
5    if site == 'cg': 
6        print('okay') 
7    else: 
8        print('retry') 
9    j += 1
10    print ('j: ' + str(j))
11print('Done') 					# okay          j: 2        Done