init date month year
This commit is contained in:
parent
194163d543
commit
bb4ba807b7
11
python-temel/init.2.py
Normal file
11
python-temel/init.2.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
class Date:
|
||||
def __init__(self):
|
||||
self.day = 1
|
||||
self.month = 1
|
||||
self.year = 1900
|
||||
|
||||
def disp(self):
|
||||
print('{}/{}/{}'.format(self.day, self.month, self.year))
|
||||
|
||||
date = Date()
|
||||
date.disp() # Date.disp(date)
|
11
python-temel/init.2.py~
Normal file
11
python-temel/init.2.py~
Normal file
|
@ -0,0 +1,11 @@
|
|||
class Date:
|
||||
def __init__(self):
|
||||
self.day = 1
|
||||
self.month = 1
|
||||
self.year = 1900
|
||||
|
||||
def disp(self):
|
||||
print('{}/{}/{}'.format(self.day, self.month, self.year))
|
||||
|
||||
date = Date()
|
||||
date.disp() # Date.disp(date)
|
Loading…
Reference in New Issue
Block a user