1/13
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
stip()
done as string.stip(), removes space at BEGINNING AND END not ALL spaces
index
what position an item is in
first inex
0
last index
-1
ex if we have 8 letters
last index is 7
to read a single item from a sequence
[ ]
ex: smg = “spamalot”
print(msg[2]) = a
slicing to get…
multiple items from a sequence
slicing syntax
sequenceVariable[startPosition:endPosition] (end goes UP TO but DOESNT INCLUDE position)
spamalot = msg, slicing string
print(msg[2:6]) = amal
len(msg)
print(msg[0:len(msg)] = would return spamalot (because it returns values)
find()
searches for first match of a substring
index find()
food = “fish taco”, index = food.find(“c”) = returns index 7
strings are
IMMUTABLE, cannot modify a single item in the sequence