Python Programming Code Flashcards
1
Q
for i in word:
print(i)
A
display each character in a string called word on separate lines
2
Q
for i in range ( 1, 10, 2)
A
displays
1, 3, 5, 7, 9
starting number: 1
end number: 10
arithmetic: 2
3
Q
for i in range( 1, 10)
print i
A
displays
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
4
Q
==
A
equal to
5
Q
!=
A
not equal to
6
Q
>
A
greater than
7
Q
<
A
less than
8
Q
> =
A
greater than or equal to
9
Q
<=
A
less than or equal to
10
Q
and
A
both conditions must be met
11
Q
or
A
either condition must be met
12
Q
text = str.lower(text)
A
changes the text to lower case
13
Q
len(word)
A
finds the length of the variable word
14
Q
word.upper()
A
changes the string into upper case
15
Q
word.lower()
A
changes the string into lowercase