More string features
Now we’re going to extend our ability to manipulate strings. The string is one of Python’s most important data structures and is at the heart of all the programs we write in this book. Python’s string-handling facilities make it one of the most powerful and easy-to-use text-processing languages. A string is indicated by quotes, which may be either single or double; for example, x = "Two"
and y = 'One'
are Python strings. Python’s ability to use two string terminators means that we can create strings like “Alan’s book” (i.e., use the apostrophe as a normal grammar element).
During the execution of a Python program, you can read a string from the keyboard and also provide a prompt in the following way.
x = input(' Please type
something ')
Executing this command displays 'Please type something
' on the screen, waits for your input, and then assigns the string you typed...