Quiz 7 Python

Ace your homework & exams now with Quizwiz!

len

This function returns the length of a string lengthof length len size

0

This is the first index in a string. 1 0 -1 The size of the string minus one

size of the string minus one

This is the last index in a string. 1 size of the string size of the string minus one 0

in

This operator determines whether one string is contained inside another string. == contains is_in in

strip

This string method returns a copy of the string with all leading and trailing whitespace characters removed. remove_whitespace clean rstrip strip

lstrip

This string method returns a copy of the string with all leading whitespace characters removed. strip_leading lstrip remove rstrip

find

This string method returns the lowest index in the string where a specified substring is found. find locate first_index_of index_of

the isalpha method

This string method returns true if a string contains only alphabetic characters and is at least one character in length. the numeric method the isalpha method the isnumber method the isdigit method

IndexError exception

This will happen if you try to use an index that is out of range for a string. String will be erased and the program will continue to run IndexError exception nothing, invalid index will be ignored ValueError exception


Related study sets

1.4 Rates of Change and Tangent Lines

View Set

Combined Physics Exam 4 Questions

View Set

non-food and by-products from animals SG

View Set

Biology - Keystone Review - 2021

View Set

Integumentary system- Checkpoint

View Set