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 :: python text color 
Python :: python array 
Python :: get multiple inputs in python using map 
Python :: python json string indices must be integers 
Python :: how to change index in dataframe python 
Python :: python planet list 
Python :: FIND MISSING NUMBER IN AN ARRAY IN PYTHON 
Python :: python program to find numbers divisible by another number 
Python :: django url static 
Python :: boxplot show values seaborn 
Python :: python easygui 
Python :: maximum and minimum value of array python 
Python :: how to allow only for create field in serializer 
Python :: creating new column with dictionary 
Python :: how to redirect in django 
Python :: Pandas: How to Drop Rows that Contain a Specific String in 2 columns 
Python :: pi in python 
Python :: python dictionary 
Python :: add to a list python 
Python :: how to run shell command in python 
Python :: merge two columns pandas 
Python :: how to use pip commands in pycharm 
Python :: how to know if a key is in a dictionary python 
Python :: Python Remove all occurrences of a character from a string 
Python :: how to convert csv to excel in python 
Python :: - inf in python 
Python :: __str__ method python 
Python :: python remove last instance of a list 
Python :: max value indices 
Python :: list comprehesion python 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =