Strings
For Loops
Slicing
100

What is a string?


A conglomeration of characters. 

100

What is a for loop?

The way to repeat the code a known number of times.

100

What is slicing?

Slicing is the division of a string.

200

What does len stand for? 

Length. 

200

True or false? 

Code does not have to be indented to operate within the for loop. 

FALSE

Code must be indented to operate within the for loop. 

200

What code is used to slice?


print(word[#:#])

300

In the word APCSP, which letter is considered index 3?

Index 3 is S. 

300
What does range(#) do? 

range(#) generates the list of numbers. 

300

If the word is "trivia", what code is needed to slice trivia into tri? (include the index numbers in your answer)

print(word[0:4])

400

Which code allows for the word length to appear on the screen? 

print(wordLength)

400

THROWBACK QUESTION: 

What command is used to debug? 

Print. 

400

If the word is "trivia", what would the following code slicing produce? 

print(word[3:])

via 


500

What code always picks the last letter?

print(word[len(word)-1])


500

In the following code, which is a fluctuating variable?

for i in range(#)

i is the fluctuating variable.

500

To add a dash to the letter v in "trivia", what code is needed? (include the index numbers)

product: tri-ia 

word = word[:3] + "-" + word[4:]  


M
e
n
u