Python Forum
Help on displaying tostring on class.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help on displaying tostring on class.
#4
Yeah, the reason why we have to use double underscores is mainly that the teacher requires them since he is out on quarantine and the teacher requires the toString method to display it like.

Output:
Name ID Number DOB Graduation date
This is what the teacher told us
Write a student class that has four properties (private variables): date of birth, name, ID number, and grade level. Write getters and setters for each property. Finally, write a toString() method that displays the student in the following format:

Name

ID number

Date of Birth

Grade Level
Reply


Messages In This Thread
RE: Help on displaying tostring on class. - by javesike1262 - Jan-10-2021, 02:24 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020