Commit 4dff9579 by ajil.k

updated assignment1

parent eba74e5a
# inherited Exception class
class TestException(Exception):
pass
class Circle:
def __init__(self, radius):
self.radius = radius
......@@ -13,6 +15,7 @@ class Circle:
print("\nException Occurred\n")
finally:
print("---------------------------")
def perimeter_circle(self):
try:
perimeter = 2 * 3.14 * self.radius
......@@ -20,4 +23,4 @@ class Circle:
except TestException:
print("\nException Occurred\n")
finally:
print("---------------------------")
\ No newline at end of file
print("---------------------------")
......@@ -21,4 +21,4 @@ class Square:
except TestException:
print("\nException Occurred\n")
finally:
print("---------------------------")
\ No newline at end of file
print("---------------------------")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment