0
class User:

    def __init__(self, username, mail, date_of_birth, gender, password):
        self.username = username
        self.mail = mail
        self.date_of_birth = date_of_birth
        self.gender = gender
        self.password = password

    def get_username(self):
        return self.username

    def get_mail(self):
        return self.mail

    def get_date_of_birth(self):
        return self.date_of_birth
    def get_gender(self):
        return self.gender

    def get_password(self):
        self.password



Matt = User("Matterson", "ville@gmail.com", 15.08.1999, "Password987")

Hi, this is my code but the date is invalid syntax, how do i write the date as a parameter?

ForceBru
  • 43,482
  • 10
  • 63
  • 98
loky
  • 1
  • 2
  • 1
    You can use the [`datetime` module](https://docs.python.org/3.9/library/datetime.html#module-datetime). Python doesn't have special syntax for dates. – ForceBru Oct 26 '20 at 19:36
  • this may [help](https://stackoverflow.com/questions/466345/converting-string-into-datetime) you, you need to make a common format for date and convert that input date to date object to self.date_of_birth – sahasrara62 Oct 26 '20 at 19:39

0 Answers0