Last active
October 2, 2017 01:48
-
-
Save SpikeXy/7bf8371d363f2b0f85f4f4d0744015f6 to your computer and use it in GitHub Desktop.
str #python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> class Student(object): | |
... def __init__(self, name): | |
... self.name = name | |
... def __str__(self): | |
... return 'Student object (name: %s)' % self.name | |
... | |
>>> print(Student('Michael')) | |
Student object (name: Michael) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment