Categories
How, when calling a class object via print, was its attribute displayed?
How to implement to print id?
class User(): id = 12345678 user1 = User() print(user1)
Answer the question
In order to leave comments, you need to log in
def __str__(self): return str(self.id)
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question