Commit dc372652 by arun.uday

second commit

parent 2528cc56
......@@ -5,6 +5,9 @@ from scripts import Square
# User Inputs
while True:
# checks for calculation choice error
error = 0
shape_choice = input("Enter rectangle/ circle/ square/ quit")
if shape_choice == 'quit':
break
......@@ -19,7 +22,7 @@ while True:
elif calculation_choice == 'perimeter':
print(f'Perimeter : {Rectangle.Perimeter(rect_length, rect_breadth).display_perimeter()}')
else:
print("Invalid calculation choice")
error = 1
# choice is circle
elif shape_choice == 'circle':
......@@ -29,7 +32,7 @@ while True:
elif calculation_choice == 'perimeter':
print(f'Perimeter : {Circle.Perimeter(circle_radius).display_perimeter()}')
else:
print("Invalid calculation choice")
error = 1
# choice is square
elif shape_choice == 'square':
......@@ -39,8 +42,11 @@ while True:
elif calculation_choice == 'perimeter':
print(f'Perimeter : {Square.Perimeter(square_side).display_perimeter()}')
else:
print("Invalid calculation choice")
error = 1
# invalid choice
else:
print("Please check the spelling.....")
if error == 1:
print("Calculation choice error....")
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