CSC 203 Final: Strings

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/7

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

8 Terms

1
New cards

string_name.count(‘substring’)

Returns the number of times its substring occurs in the string. Optionally takes start index and end index to search a substring of the string.

2
New cards

string_name.count(‘substring’, start_index)

count searches only the slice string[start_index:]—that is, from start_index through end of the string

3
New cards

string_name.count(‘substring’, start_index, end_index)

count searches only the slice string[start_index:end_index]—that is, from start_index up to, but not including, end_index

4
New cards

string_name.index(‘substring’)

Searches from the beginning of the string and returns the first index at which a substring is found; raises ValueError if not found.

5
New cards

string_name.rindex(‘substring’)

Searches from the end of the string and returns the first index of the substring; raises ValueError if not found.

6
New cards

‘substring’ in string_name

Returns True if the string does contain the substring.

7
New cards

string_name.startswith(‘substring’)

Returns True if the string starts with the specified substring.

8
New cards

string_name.endswith(‘substring’)

Returns True if the string ends with the specified substring.