- [Instructor] Another fairly common operation in Python…is converting different kinds of values…into string representations.…So consider, for example, what happens when you use…the string formatting function.…Each one of the parameters, passed to the format function,…is converted into a string and then substituted…into the output string at that particular place holder.…Now, for some data types that's pretty straightforward,…so just converting an integer number into a string.…Python gives your custom class full control…over how it wants to represent itself in string form,…and there are essentially four main functions…used to do this.…
The first, is the str function,…this function is called on your class…when the str, print, or string.format functions…are used to convert the object to a string and, obviously,…the return value has to be a string.…This particular string is typically…an informal representation of the object.…In other words, its just a nicely formatted…human readable string, there's no expectation…
- Truth value testing
- Template strings
- Advanced Python functions
- Advanced collections
- Advanced classes and objects
- Python comprehensions: list, dictionary, and set
Skill Level Advanced
1. Python Language Features
2. Built-In Functions
3. Advanced Python Functions
4. Advanced Collections
5. Advanced Classes and Objects
6. Using Logging
7. Python Comprehensions
- 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.