-
Notifications
You must be signed in to change notification settings - Fork 0
/
OOPS kili.py
71 lines (58 loc) · 1.29 KB
/
OOPS kili.py
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# > scop concept <
# def Check_scope():
# def do_local():
# test = "local test"
#
# def do_non_local():
# nonlocal test
# test = "non local test"
#
# def do_global():
# global test
# test = "global test"
#
# test = "default"
# print("test value after do local :" + test)
#
# do_non_local()
# print("test value after non do local :" + test)
#
# do_global()
# print("test value after global :"+test)
#
#
#
# Check_scope()
# print("test value after main :"+test)
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<
# class and object
# class MySampleClass:
# def hello(self, nm):
# self.name = nm
#
# def print(self):
# print("hallo "+self.name)
#
#
# x = MySampleClass()
# x.hello("shammas")
# x.print()
#
# y = MySampleClass()
# y.hello("fiyas")
# y.print()
#><>><><><><><>>>><><><><><><>>><><><><>
# class and function with costrector
# class Sample:
# def __init__(self, name, age, place):
# self.name = name
# self.age = age
# self.place = place
# def add_age(self):
# self.age = self.age+1
# def relocate(self,place):
# self.place = place
# a = Sample("shammas", 24, "vavad")
# b = Sample("fiyas", 23, "parappen poyil")
# a.add_age()
# b.add_age()