Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python Iterating Through a string

# Iterating through a string
count = 0
for letter in 'Hello World':
    if(letter == 'l'):
        count += 1
print(count,'letters found')
Source by www.codecademy.com #
 
PREVIOUS NEXT
Tagged: #Python #Iterating #Through #string
ADD COMMENT
Topic
Name
7+8 =