Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
Internship-Training
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ajil.k
Internship-Training
Commits
4dff9579
Commit
4dff9579
authored
Jan 17, 2023
by
ajil.k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated assignment1
parent
eba74e5a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
shape/circle.py
+4
-2
shape/square.py
+1
-2
No files found.
shape/circle.py
View file @
4dff9579
# inherited Exception class
# inherited Exception class
class
TestException
(
Exception
):
class
TestException
(
Exception
):
pass
pass
class
Circle
:
class
Circle
:
def
__init__
(
self
,
radius
):
def
__init__
(
self
,
radius
):
self
.
radius
=
radius
self
.
radius
=
radius
...
@@ -13,6 +15,7 @@ class Circle:
...
@@ -13,6 +15,7 @@ class Circle:
print
(
"
\n
Exception Occurred
\n
"
)
print
(
"
\n
Exception Occurred
\n
"
)
finally
:
finally
:
print
(
"---------------------------"
)
print
(
"---------------------------"
)
def
perimeter_circle
(
self
):
def
perimeter_circle
(
self
):
try
:
try
:
perimeter
=
2
*
3.14
*
self
.
radius
perimeter
=
2
*
3.14
*
self
.
radius
...
@@ -20,4 +23,4 @@ class Circle:
...
@@ -20,4 +23,4 @@ class Circle:
except
TestException
:
except
TestException
:
print
(
"
\n
Exception Occurred
\n
"
)
print
(
"
\n
Exception Occurred
\n
"
)
finally
:
finally
:
print
(
"---------------------------"
)
print
(
"---------------------------"
)
\ No newline at end of file
shape/square.py
View file @
4dff9579
...
@@ -21,4 +21,4 @@ class Square:
...
@@ -21,4 +21,4 @@ class Square:
except
TestException
:
except
TestException
:
print
(
"
\n
Exception Occurred
\n
"
)
print
(
"
\n
Exception Occurred
\n
"
)
finally
:
finally
:
print
(
"---------------------------"
)
print
(
"---------------------------"
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment