-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercises9-12.py
More file actions
44 lines (30 loc) · 806 Bytes
/
exercises9-12.py
File metadata and controls
44 lines (30 loc) · 806 Bytes
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
import math
class PySolutions():
def __init__(self):
self.string = ""
def get_String(self):
self.string = input("Type in something: ")
def print_String(self):
print(self.string.upper())
class Rectangle():
def __init__(self, l, w):
self.length = l
self.width = w
def find_Area(self):
area = self.length * self.width
return area
class Circle():
def __init__(self, radius):
self.r = radius
def get_Area(self):
area = self.r**2 * math.pi
return round(area, 2)
def get_Perimeter(self):
perimeter = 2*self.r*math.pi
return round(perimeter, 2)
string = PySolutions()
string.get_String()
string.print_String()
C1 = Circle(5)
print(C1.get_Area())
print(C1.get_Perimeter())