Python 3.6.1 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux
calc_volume(5,6,7)
Enter the length: 5
Enter the width: 6
Enter the heigth: 7
Traceback (most recent call last):
File "python", line 1, in <module>
File "python", line 5, in calc_volume
TypeError: can't multiply sequence by non-int of type 'str'
This is what I get on the console when I run the code below:
def calc_volume(length=float, width=float, height=float):
length = input("Enter the length: ")
width = input("Enter the width: ")
height = input("Enter the heigth: ")
calc_volume = (str(length) * str(width) * str(height))
print("The volume of the rectangular prism is " + calc_volume)
return calc_volume()
I need to get length x width x height and keep getting errors.