Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Lists and for loops

for number in range(20):
    if number % 3 == 0:
        print(number)

for fruit in ["banana", "apple", "quince"]:
    print("I like to eat " + fruit + "s!")
Comment

lists and for loops in python

# This is one of the most commonly used combinations in Python
friends = ['Sam', 'John', 'Anne']
for friend in friends:
    print('Happy New Year, my friend', friend + '!')
print('Done')
Comment

PREVIOUS NEXT
Code Example
Python :: scrapy pass string as html 
Python :: colorama input python 
Python :: python set literal 
Python :: len of square matrix 
Python :: comprehensions 
Python :: python filter function 
Python :: File "<ipython-input-12-48c6c043344b", line 29 coin = random.randint(0,1) ^ IndentationError: expected an indented block 
Python :: uneven chunks of array slices 
Python :: obspy stats 
Python :: p and c in python 
Python :: check if entry is NaT] 
Python :: onetomany field 
Python :: scrapy capture: Error downloading 
Python :: filter pandas stack overflow 
Python :: check if a string is a palindrome python 
Python :: Extract all bounding boxes using OpenCV Python 
Python :: python assertRaises with class property 
Python :: python as-lookup 
Python :: os.startfile on raspberry 
Python :: python 3.10 windows 7 
Python :: python text to speech arabic 
Python :: numpy array to int type 
Python :: python vectorize 
Python :: transpose of a matrix in python using loop 
Python :: change value in dataframe 
Python :: how to find duplicates in pandas 
Python :: python while true 
Python :: python libraries 
Python :: how to sort nested list in python 
Python :: python bot 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =