-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent_course3.py
More file actions
49 lines (45 loc) · 1.13 KB
/
student_course3.py
File metadata and controls
49 lines (45 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# class first():
# # def __init(self,name):
# # self.cname = name
#
# def class1(self):
# print("this is first class")
#
# def class2(self):
# a = input("enter a value")
# print("this is the first class returned to", a)
#
# def datetoday(self):
# print(c2.currentdate())
#
# class second():
#
# def currentdate(self):
# a = "sombar,mangshir 2076"
# return a
#
# c2 = second()
# c1 = first()
# c1.class1()
# c1.class2()
# c1.datetoday()
class first():
def __init__(self,cname):
self.cname = cname
def returnName(self):
return"name of class is first "
def returnCostomName(self):
return"name of claas set by user is :::"+self.cname
def getDateFromOtherClass(self):
obj = second()
val = obj.getDate()
return"date returned from first class second object is :::"+val
class second():
def __init__(self):
self.val =""
def getDate(self):
return"today date is mangshir 23 2017"
first = first('jpt')
print(first.returnName())
print(first.returnCostomName())
print(first.getDateFromOtherClass())