0
Do not print
Hi guys, do you know what's wrong with this code, that it doesn't call me back? It's not wrong I just don't have the answer. https://code.sololearn.com/cbyh6KH0s3FX class Student(): name= "Pedro" age = "22" def __str__(self): print("My name is", "" , self.name, self.age) student = Student() Milion thanks
3 Answers
+ 2
Put the relevant programming language in tag section, not user names. Please put your code in a script on sololearn playground and link it.
You did not call the method:
student.__str__()
+ 2
https://code.sololearn.com/c6GcP8YF2vTT/?ref=app
instead of str its init (short for inititialize )
+ 1
Lisa, it has worked :)
Thank you