Python Forum
Making a Class Person ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making a Class Person ?
#1
How do I create a Person class is a generic class, which only stores some basic attributes. These attributes are: name, sex and date of birth (as a datetime object). The attributes must be invisible outside the object.
Write a constructor for this class that takes three arguments (name, sex ('M' or 'F') and date of birth (as a date string)).
Reply


Messages In This Thread
Making a Class Person ? - by Kessie1971 - Apr-23-2023, 11:14 AM
RE: Making a Class Person ? - by deanhystad - Apr-23-2023, 12:31 PM
RE: Making a Class Person ? - by Kessie1971 - Apr-23-2023, 04:47 PM
RE: Making a Class Person ? - by deanhystad - Apr-23-2023, 05:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  print(f"{person}:") SyntaxError: invalid syntax when running it AryaIC 11 16,380 Nov-07-2020, 10:17 AM
Last Post: snippsat
  How can create class Person :( Azilkhan 1 1,972 Nov-21-2019, 08:12 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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