I'm fairly new to this stuff and keep getting an error message on line 19:
(while user_input.lower() != "quit":
^
SyntaxError: invalid syntax
let me know if you see the problem! :)
(while user_input.lower() != "quit":
^
SyntaxError: invalid syntax
let me know if you see the problem! :)
# import math library
import math
# import volume.py to import the volume calculations
import volume
# define main function in order to store the given variables
def main():
cube_vol = 0
pyramid_vol = 0
ellip_vol = 0
cube_result = []
pyramid_result = []
ellipsoid_result = []
option = ""
user_input = (input("Choose a shape: cube, pyramid, or ellipsoid or q/quit to quit")
while user_input.lower() != "quit":
# if the user inputs "cube", the following path is executed to prompt the user with instructions to determine the volume
if user_input.lower() == "cube":
# program will ask user to enter the cube's width
cube_width = input("Enter cube width:")
# if the input is valid, the program will calculate the volume of the cube
if isDigit(cube_width) == True:
cube_vol = cube_volume(float(cube_width))
#use imported values from volume file to determine the volume of the specific cube value
volume.cube_volume(cube_vol)
print("The volume of the cube with the length of {} is {}.".format(width, cube_vol))
# if the output was invalid (not a valid number) then the program will display the input is invalid
else:
option = "cube"
print("Invalid input. Please try again.")
