Python TutorialLesson 11Free preview
Python Strings
This lesson is part of Python · All levels
Summary
Strings are a type of data for storing text and are made with single or double quotes. Each character in a string has an index that starts at 0, so we can access or cut out the text using indexing and slicing. Python also provides many built-in methods such as upper(), strip(), and split() to facilitate text processing.
Key points
- Strings are made with single or double quotes and the two are equivalent.
- The first character index is 0, while the index -1 refers to the last.
- Slicing s[start:end] takes the character's cut to before the end.
- Inbuilt methods such as len(), upper(), lower(), and strip() process text.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.