Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python continue vs pass

Yes, there is a difference. 

continue forces the loop to start at the next iteration 
while pass means "there is no code to execute here" 
and will continue through the remainder or the loop body. 
continue will jump back to the top of the loop. 
pass will continue processing.
https://stackoverflow.com/questions/9483979/is-there-a-difference-between-continue-and-pass-in-a-for-loop-in-python
Comment

continue vs pass python

for element in some_list:
    if not element:
        pass
    print 1 # will print after pass

for element in some_list:
   if not element:
       continue
   print 1 # will not print after continue
Comment

PREVIOUS NEXT
Code Example
Python :: import stopwords 
Python :: list count frequency python 
Python :: how to read a .exe file in python 
Python :: read_csv Unnamed: 0 
Python :: discord python wait for user input 
Python :: log base in python 
Python :: values of unique from dataframe with count 
Python :: django queryset group by sum 
Python :: plotly hide trace from hover 
Python :: find nan values in a column pandas 
Python :: python read music stream 
Python :: how to multiply two tuples in python 
Python :: show number as 3 digit python 
Python :: how to iterate through a text file in python 
Python :: scikit learn split data set 
Python :: random word python 
Python :: parquet pyspark 
Python :: how to convert a pandas series from int to float in python 
Python :: median in python 
Python :: shift coordinate in python 
Python :: python delete key from dict 
Python :: sqlalchemy create engine PostgreSQL 
Python :: convert set to list python time complexity 
Python :: pandas find basic statistics on column 
Python :: matplotlib rc params 
Python :: pandas to csv float format 
Python :: how to check if mouse is over a rect in pygame 
Python :: python set a specific datetime 
Python :: pillow read from ndarray 
Python :: how to rotate plot in jupyter 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =