© Irv Kalb 2018
Irv KalbLearn to Program with Python 3https://doi.org/10.1007/978-1-4842-3879-0_8

8. Strings

Irv Kalb1 
(1)
Mountain View, California, USA
 

Other than using them to nicely format output, we haven’t talked much about strings. In this chapter and the next two chapters, we get heavily into strings. I'll show you how to manipulate them and find smaller strings within larger strings.

We started using strings in Chapter 1 with this statement:
print('Hello World')
Later, we talked about how you get input from the user as a string, and how to convert that input into a number:
>>>
>>> age = input('Please enter your age: ')
Please enter your age: 24
>>> age = int(age)
>>>
Then I showed you how to concatenate strings, like this:
>>>
>>> string1 = 'Hello' ...

Get Learn to Program with Python 3: A Step-by-Step Guide to Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.