April 2024
Beginner to intermediate
500 pages
24h 20m
English
In this chapter, we explored an important Python data type called strings—sequences of characters that provide a wide range of built-in functions, string operators, and methods.
String operators:
Concatenation (+)
Repetition (*)
Indexing ( [] )
Slicing ([:] )
Membership (in and not in)
Length (len) built-in function
String search methods:
find/rfind
index/rindex
String formatting methods:
upper
lower
center
ljust
rjust
Other string methods
replace
count
startswith
countains
We also introduced Python built-in character functions:
ord
chr
We distinguished between positional and keyword parameters with an example using the print function.
We used decomposition to build up a collection of small functions that could be used ...
Read now
Unlock full access