-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCode.py
More file actions
41 lines (32 loc) · 1 KB
/
Code.py
File metadata and controls
41 lines (32 loc) · 1 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
from abc import ABC, abstractmethod
class MotorCycle(ABC):
wheels = 2
def __init__(self, model=None, price=None, ownerName =None):
self.model = model
self._price = price
self.__ownerName = ownerName
def get_Owner_Name(self):
return self.__ownerName
@abstractmethod
def show_color(self):
pass
class SportsBike(MotorCycle):
def __init__(self, model, price, topSpeed, ownerName, color):
super().__init__(model, price, ownerName)
self.topSpeed = topSpeed
self.color = color
def show_details(self):
print('Model ', self.model)
print('price', self._price)
print('Topspeed ', self.topSpeed)
# print('Owner name', self.ownerName)
def show_color(self):
print("Color of this bike is ", self.color)
lst = "ABCD"
n = len(lst)
for i in range(0, n+1):
for j in (i, n/2):
print(" " , end="")
print(lst[0:i])
# for j in range(0, i):
# print(lst[j])