0

How can I write this code in a class?

import datetime

now = datetime.datetime.today().year
my_date = input().split('/')

if int(my_date[1]) > 12 or int(my_date[2]) > 31:
    print('WRONG')
else:
    my_age = now - int(my_date[0])
    print(int(my_age))

when I write it in a class it doesn't work propery

Hm tk
  • 23
  • 4

0 Answers0