class date mutable

This commit is contained in:
Mert Gör ☭ 2023-06-17 14:53:33 +03:00
parent 7c5681f7d3
commit e6c98179c4
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,12 @@
class Date:
def set(self, day, month, year):
self.day = day
self.month = month
self.year = year
def disp(self):
print('{}/{}/{}'.format(self.day, self.month, self.year))
date = Date()
date.set(10, 12, 1990)
date.disp()

View File

@ -0,0 +1,8 @@
class Date:
def set(self, day, month, year):
self.day = day
self.month = month
self.year = year
def disp(self):
print('{}/{}/{}'.format(self.day, self.month, self.year))