I have run into an error where a block of code in python 3.7 has caused multiple outputs where one is expected. The code is as follows:
def main():
length=0;height=0;width=0;volume=0
length,height,width=getinput(length,height,width)
volume=processing(length,height,width,volume)
output(volume)
def getinput(length,height,width):
length, height, width = input("Enter length, height, and width:").split(',')
length = int(length)
height = int(height)
width = int(width)
return length,height,width
def processing(length,height,width,volume):
volume = length * height * width
return length,height,width,volume
def output(volume):
print("the volume of the prism is:", volume)
main()
The output should be:
the volume of the prism is: 400
The output is:
the volume of the prism is: (20, 10, 2, 400)
outputprintsvolume, which comes fromprocessing, which returnslength,height,width,volume. Four outputs are expected. If you are expecting one,return volumefromprocessing.