forked from m-kashani/Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
# Karbordhaye method constructor? | ||
# ------------------------------- | ||
|
||
from datetime import datetime # Ino man import mikonam ta betoonam ba object datetime kar konam. | ||
# Onject zaman ro mikham azash estefade konam. | ||
|
||
class ClassName: | ||
''' | ||
author: Mahdi. | ||
email: mahdi@uga.edu. | ||
''' | ||
|
||
# Different methods have different names due to their responsibilities. One of them is constructor which we make an object that method happens! | ||
def __init__(self): | ||
def __init__(self): # Initialize. # This is the constructor method. and as usual we should pass it the self. | ||
self.created = datetime.now() | ||
self.birth = | ||
|
||
print('Object is created') | ||
|
||
|
||
|
||
def thisFunctionName(self, name): | ||
print(name) # Har tabe besoorate pishfarz None ro bar migardoone. | ||
|
||
if __name__ == '__main__': # Module besurate dasti ejra shode. | ||
obj1 = ClassName() # Making an instance from an object. | ||
|
||
print(datetime.now()) |