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 :: key pressed pygame 
Python :: are tuples in python mutable 
Python :: pypdf2 advanced tutorial 
Python :: change every element of list python with map 
Python :: using hashlib module in python 
Python :: python coding practice 
Python :: how to concatenate two strings in python 
Python :: python argsort 
Python :: How to Get the Symmetric Difference of Sets in Python 
Python :: python construct a string 
Python :: Python Sum of an array in NumPy 
Python :: pandas convert string to float 
Python :: how to split from a specific charecter to the end of the string in python 
Python :: how to make a 2d array in python 
Python :: how to refer to all columns in pandas 
Python :: how to delete a column in pandas dataframe 
Python :: semicolon python 
Python :: # /usr/bin/env python windows 
Python :: queue peek python 
Python :: swapping variables 
Python :: time zone in python 
Python :: draw bipartite graph networkx 
Python :: for each in python 
Python :: zip function python 
Python :: pandas read csv with lists 
Python :: how to add a 2d array to one dataframe colum 
Python :: closures in python 
Python :: python code for internet radio stream 
Python :: what is best app for Python 
Python :: strip plot (normal) 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =