-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOops(01).py
More file actions
64 lines (50 loc) · 1.3 KB
/
Oops(01).py
File metadata and controls
64 lines (50 loc) · 1.3 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
"""Oops"""
#developed ny 1960 to 1970
#developed by ole johan dahi and kristen Nygaard at norwegain computer center in 1967
# when they creat programing language simula
#class--> it is a blueprint for creatinggg objects
#object --> it is an instance of a class
"""define a class"""
# class car:
# color ='red' #atribute
# model ="2023" #method
# def start(self):
# print("booommm")
# def stop(self):
# print("stop......")
# #Now create objects
# scorpio=car()
# # print(scorpio.color) #calling paramiter
# scorpio.start() #callinng mathod
"""Access"""
# class car:
# color="black"
# model="2000"
# def start(self):
# return "booommmm"
# def stop(self):
# return "stop"
# BMW=car()
# print(BMW.start())
"""change properties for perticuler object"""
# class car:
# color="black"
# model="2000"
# def start(self):
# return "booommmm"
# def stop(self):
# return "stop"
# BMW=car()
# BMW.color="red"
# print(BMW.color)
"""change class atribute"""
# class car:
# color="black"
# model="2000"
# def start(self):
# return "booommmm"
# def stop(self):
# return "stop"
# car.color="white"
# BMW=car()
# print(BMW.color)