Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I wrote this code with Pycharm, there are some bugs, can someone help me correct it? elif shape == e or shape == ellipsoid: x
I wrote this code with Pycharm, there are some bugs, can someone help me correct it?
elif shape == "e" or shape == "ellipsoid": x = float(input("Please enter the radius x: ")) y = float(input("Please enter the radius y: ")) z = float(input("Please enter the radius z: ")) ellipsoidlist.append(volumes.volumeEllipsoid(x,y,z)) elif shape == "q" or shape == "quit": break else: print("Invalid input") print("You have reached the end of your session. The volumes calculated for each shape are:") if len(cubelist) == 0: print("Cube: No shapes entered") else: sumcube = sum(cube list) maxcube = max(cubelist) mincube = min(cubelist) print("Cube: ", sumcube, maxcube, mincube) if len(ellipsoidlist) == 0: print("Ellipsoid: No shapes entered") Felse: sumellipsoid = sum(ellipsoidlist) maxellipsoid = max(ellipsoidlist) minellipsoid = min(ellipsoidlist) print("Ellipsoid: ", sumellipsoid, maxellipsoid, minellipsoid) Run: A H ICE D1- * main Please enter the radius z: 3 Please enter a shape: 9 You have reached the end of your session. The volumes calculated for each shape are: Cube: No shapes entered Traceback (most recent call last): File "/Users/liuyunqing/Documents/main.py", line 45, inStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started