Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kl_shapes
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
arun.uday
kl_shapes
Commits
dc372652
Commit
dc372652
authored
Jan 17, 2023
by
arun.uday
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
second commit
parent
2528cc56
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
main.py
+9
-3
No files found.
main.py
View file @
dc372652
...
@@ -5,6 +5,9 @@ from scripts import Square
...
@@ -5,6 +5,9 @@ from scripts import Square
# User Inputs
# User Inputs
while
True
:
while
True
:
# checks for calculation choice error
error
=
0
shape_choice
=
input
(
"Enter rectangle/ circle/ square/ quit"
)
shape_choice
=
input
(
"Enter rectangle/ circle/ square/ quit"
)
if
shape_choice
==
'quit'
:
if
shape_choice
==
'quit'
:
break
break
...
@@ -19,7 +22,7 @@ while True:
...
@@ -19,7 +22,7 @@ while True:
elif
calculation_choice
==
'perimeter'
:
elif
calculation_choice
==
'perimeter'
:
print
(
f
'Perimeter : {Rectangle.Perimeter(rect_length, rect_breadth).display_perimeter()}'
)
print
(
f
'Perimeter : {Rectangle.Perimeter(rect_length, rect_breadth).display_perimeter()}'
)
else
:
else
:
print
(
"Invalid calculation choice"
)
error
=
1
# choice is circle
# choice is circle
elif
shape_choice
==
'circle'
:
elif
shape_choice
==
'circle'
:
...
@@ -29,7 +32,7 @@ while True:
...
@@ -29,7 +32,7 @@ while True:
elif
calculation_choice
==
'perimeter'
:
elif
calculation_choice
==
'perimeter'
:
print
(
f
'Perimeter : {Circle.Perimeter(circle_radius).display_perimeter()}'
)
print
(
f
'Perimeter : {Circle.Perimeter(circle_radius).display_perimeter()}'
)
else
:
else
:
print
(
"Invalid calculation choice"
)
error
=
1
# choice is square
# choice is square
elif
shape_choice
==
'square'
:
elif
shape_choice
==
'square'
:
...
@@ -39,8 +42,11 @@ while True:
...
@@ -39,8 +42,11 @@ while True:
elif
calculation_choice
==
'perimeter'
:
elif
calculation_choice
==
'perimeter'
:
print
(
f
'Perimeter : {Square.Perimeter(square_side).display_perimeter()}'
)
print
(
f
'Perimeter : {Square.Perimeter(square_side).display_perimeter()}'
)
else
:
else
:
print
(
"Invalid calculation choice"
)
error
=
1
# invalid choice
# invalid choice
else
:
else
:
print
(
"Please check the spelling....."
)
print
(
"Please check the spelling....."
)
if
error
==
1
:
print
(
"Calculation choice error...."
)
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