-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathclass23.py
More file actions
76 lines (54 loc) · 1.39 KB
/
Copy pathclass23.py
File metadata and controls
76 lines (54 loc) · 1.39 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# lst = (22,34,25,123) #iterable
# lst_it = iter(lst)
# print(next(lst_it))
# print(next(lst_it))
# print(next(lst_it))
# print(next(lst_it))
#-5,0,5,10,15,20
# def my_gen():
# for i in range(-5,21,5):
# yield i
# genarat = my_gen()
# for num in genarat:
# print(num)
# def makeup_fun(func):
# def wrapper():
# print("I became beautiful.")
# func()
# print("Done makeup.")
# return wrapper
# def greetings():
# print("Good Night")
# my_fun = makeup_fun(greetings)
# my_fun()
class WorldBank:
def __init__(self,name,balance): #constractor
self.balance = balance
self.name = name
print("A new Account is created.")
def myfun(self):
print("Good Night",self.name)
person1 = WorldBank("Nasim",500)
print(person1.name)
print(person1.balance)
person2 = WorldBank("Eshikhon",5000)
print(person1.name)
print(person1.balance)
print(person2.name)
print(person2.balance)
person1.myfun()
person2.myfun()
class Mobile:
def __init__(self,model):
self.sim = 2
self.cameraCount = 3
self.display_size = 6.5
self.model = model
self.headphone_jack = False
self.cameraPixels = [30,10,100]
print("A copy of mobile is made.")
S24_Ultra = Mobile("Samsung S24 Ultra")
print(S24_Ultra.model)
print(S24_Ultra.model)
S24_Ultra.cameraCount = 10
print(S24_Ultra.cameraCount)