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
7e5ccd97
Commit
7e5ccd97
authored
Jan 17, 2023
by
ajil.k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated with new project structure.
parent
4dff9579
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
11 deletions
+18
-11
app.py
+4
-0
scripts/constants/values.py
+1
-0
scripts/core/handlers/__init__.py
+0
-0
scripts/core/handlers/circle.py
+3
-2
scripts/core/handlers/rectangle.py
+0
-0
scripts/core/handlers/square.py
+0
-0
scripts/services/main.py
+10
-9
No files found.
app.py
0 → 100644
View file @
7e5ccd97
from
scripts.services.main
import
shape
shape
()
\ No newline at end of file
scripts/constants/values.py
0 → 100644
View file @
7e5ccd97
PI
=
3.14
s
hape
/__init__.py
→
s
cripts/core/handlers
/__init__.py
View file @
7e5ccd97
File moved
s
hape
/circle.py
→
s
cripts/core/handlers
/circle.py
View file @
7e5ccd97
from
scripts.constants.values
import
PI
# inherited Exception class
class
TestException
(
Exception
):
pass
...
...
@@ -9,7 +10,7 @@ class Circle:
def
area_circle
(
self
):
try
:
area
=
3.14
*
self
.
radius
*
self
.
radius
area
=
PI
*
self
.
radius
*
self
.
radius
return
area
except
TestException
:
print
(
"
\n
Exception Occurred
\n
"
)
...
...
@@ -18,7 +19,7 @@ class Circle:
def
perimeter_circle
(
self
):
try
:
perimeter
=
2
*
3.14
*
self
.
radius
perimeter
=
2
*
PI
*
self
.
radius
return
perimeter
except
TestException
:
print
(
"
\n
Exception Occurred
\n
"
)
...
...
s
hape
/rectangle.py
→
s
cripts/core/handlers
/rectangle.py
View file @
7e5ccd97
File moved
s
hape
/square.py
→
s
cripts/core/handlers
/square.py
View file @
7e5ccd97
File moved
main.py
→
scripts/services/
main.py
View file @
7e5ccd97
"""import shapes from package 'shape'."""
from
s
hape
.rectangle
import
Rect
from
s
hape
.square
import
Square
from
s
hape
.circle
import
Circle
from
s
cripts.core.handlers
.rectangle
import
Rect
from
s
cripts.core.handlers
.square
import
Square
from
s
cripts.core.handlers
.circle
import
Circle
# iterating variable
i
=
1
while
i
==
1
:
def
shape
():
# iterating variable
i
=
1
while
i
==
1
:
print
(
"----------Area & Perimeter----------
\n
"
"1.Rectangle
\n
"
"2.Circle
\n
"
"3.Square
\n
"
"4.Enter 0 to e
xit
\n
"
)
"4.E
xit
\n
"
)
choice
=
int
(
input
(
"Enter the choice: "
))
if
choice
==
1
:
rect_length
=
float
(
input
(
...
...
@@ -41,6 +42,6 @@ while i == 1:
square_inst
.
area_square
())
print
(
"Perimeter of Square: "
,
square_inst
.
perimeter_square
())
elif
choice
==
0
:
elif
choice
==
4
:
i
=
0
# Exit if ch
# Exit if choice is 4
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