Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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
Comment

indentation in python

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

what is indentation in python

#indentation in python matters because indentation refers to the spaces at the 
#beginning of a code line.
#indentation in python is inportant becuse python do not use {} to ditermine  
#the part of code insted it uses indentation to understand if the code is part 
#of functon , loop, condition and etc 
#following is the example run this code in your ide and find the diffrences
#good luck to find the diffrences
if 5 > 2:
  print("Five is greater than two!")
  
if 5 > 2:
print("Five is greater than two!")

if 5 > 2:
 print("Five is greater than two!") 
if 5 > 2:
        print("Five is greater than two!") 
Comment

PREVIOUS NEXT
Code Example
Python :: python single line comment 
Python :: python spread operator 
Python :: length of list without len function 
Python :: run python script inside bash script 
Python :: append list python 
Python :: how to extract zip file using python 
Python :: combining strings in python 
Python :: list methods in python 
Python :: yaml validator python 
Python :: python merge two list 
Python :: function in python 
Python :: re.search() 
Python :: how to get last letter of string python 
Python :: print command python 
Python :: tkinter change button color smoothly 
Python :: python api request 
Python :: python increment filename by 1 
Python :: example of tinker in python 
Python :: os dir exists 
Python :: yahoo finance python documentation 
Python :: validationerror django params 
Python :: change tuple python 
Python :: matplotlib temperature celsius 
Python :: Python Print Variable Using the string formatting with positional arguments {} 
Python :: telegram.ext python 
Python :: python status code to string 
Python :: check if object exists python 
Python :: python map function 
Python :: python write list to file with newlines 
Python :: py list 3d 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =