Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python for in

# Measure some strings:
words = ['cat', 'window', 'defenestrate']

# loop over words
for w in words:
	print(w, len(w))

# output 
cat 3
window 6
defenestrate 12
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #python
ADD COMMENT
Topic
Name
5+5 =