Question: 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?

I wrote this code with Pycharm, there are some bugs, can someonehelp me correct it? elif shape == "e" or shape == "ellipsoid":

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, in sumellipsoid = sum(ellipsoidlist) TypeError: unsupported operand type(s) for +: 'int' and 'str' Process finished with exit code 1 def volumeEllipsoid(x,y,z): volume E = math.pi * X * Y * Z* 4 / 3 return "0.2f"%(volumeE)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!