Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

String Conversion for Python Containers (Lists, Dicts, …)

Give Feedback

This is the final lesson in the course. In it, you’ll see how containers like lists and tuples convert their children to strings when called with str(). The lesson also encourages you to add a __repr__ method to your classes.

michelnakhla on July 20, 2019

Very brief and nice.

paulakula11 on Aug. 28, 2019

concise and clear

Silver on Dec. 7, 2019

awesome!

Lokman on Feb. 27, 2020

Thanks @DanBader for best practice always provide __repr__ for classes. I guess dunder repr short form for represent.

sroux53 on June 5, 2020

Excellent!

Vaibhav Kumar on July 19, 2020

Very well crisp and concise.

avalidzy on July 23, 2020

Excellent voice delivery! The “dunder” use methodology is more apparent to me. Thanks Dan!

Idris Diba on Aug. 3, 2020

I learned a lot from this tutorial. Thank you Dan for your excellent method of teaching.

vikrant06 on Aug. 16, 2020

neat

Become a Member to join the conversation.