Login
📚 Introduction to Python Programming
Chapters ▾
⇩ Download ▾

8.6 Chapter summary

Highlights from this chapter include:

At this point, you should be able to write programs dealing with string values.

Table 8.4 Chapter 8 reference.
MethodDescription
lenReturns the string length.
upperReturns uppercase characters.
lowerReturns lowercase characters.
countReturns the number of a given substring in a string.
findReturns the index of the first occurrence of a given substring in a string. If the substring does not exist in the string, -1 is returned.
indexReturns the index of the first occurrence of a given substring in a string. If the substring does not exist in the string, a ValueError is returned.
formatUsed to create strings with specified patterns using arguments.
joinTakes a list of string values and combines string values into one string by placing a given separator between values.
splitSeparates a string into tokens based on a given separator string. If no separator string is provided, blank space characters are used as separators.
OperatorDescription
inChecks if a substring exists in a string.
in operator in a for loop for character in string:   # loop body