Commit dc372652 by arun.uday

second commit

parent 2528cc56
...@@ -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....")
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