The Python string type is much more than it appears. This lesson covers the fundamentals of string methods and formatting.
- [Instructor] In Python 3,…all types are classes, even the built-in types.…Mostly this fact is transparent, you'll never notice it.…In the case of the string type, it's very useful to know.…Here in Komodo, I've opened a working copy of types.py…from Chapter 3 of the exercise files.…We'll go into much more detail…about string objects in a later chapter,…but for now it's good to understand a few common patterns.…First of all,…let me change this 7 to the word seven in a string.…
You notice that the string is wrapped in single quote marks.…And when I save and run this,…we have the x is seven and the type's str,…which is the internal string type.…But it's good to know that the single quotes…is a style choice.…Double quotes are exactly the same.…If I save and run this,…you see we have exactly the same result.…There is no difference between single quotes…and double quotes in Python.…In some languages double quotes are interpolated,…single quotes are not, or there may be other distinctions.…
In Python, there is no difference whatsoever.…
- Python anatomy
- Types and values
- Conditionals and operators
- Building loops
- Defining functions
- Python data structures: lists, tuples, sets, and more
- Creating classes
- Handling exceptions
- Working with strings
- File input/output (I/O)
- Creating modules
- Integrating a database with Python db-api
Skill Level Intermediate
Python: Programming Efficientlywith Michele Vallisneri2h 15m Intermediate
2. Language Overview
3. Types and Values
8. Structured Data
11. String Objects
12. File I/O
13. Built-in Functions
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.