What is the structure of a for loop
For i in range (0,10)
What does the break command do
Breaks the loop when the condition is reached or when break shows up in the program
What is the structure of while loop
While(i<——)
What is the list comprehension structure
vowels = [‘a’, ‘e’, ‘i’, ‘o’, ‘u’]
If text[i] in vowels:
print(“——“)
How do you use a counter
Count=0
If character fits the condition(s)
Count=count+1
What’s important in a loop
What is the structure of the length command
Length=len(——)
How do you separate out a single character from a string
For letter k:
School=“kisc”
Print(school[0])
How do you separate out multiple letter from a string
For ki:
School=“kisc”
Print(school[0:2])
What will this print:
School=“kisc”
Print(school[2:])
Everything after 2, including 2
What will this print:
School=“kisc”
Print(school[:2])
Everything before 2, not including 2
What is important to remember for string handling
What is important to remember for list comprehension