I am learning Python, and I got an error, searched online but I still don't understand why. What am I doing wrong?
Code:
length = float(input("please input the length: "))
unit = input("please input the unit: ")
if unit == "in" or "inch":
length_b = float(length / 2.54)
print("%f inch = %f cm"(length, length_b))
elif unit == "cm":
length_b = float(length * 2.54)
print("%f cm = %f inch"(length, length_b))
else:
print("calculation failed")
and I got this error:
test.py:143: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
print("%f inch = %f cm"(length, length_b))
test.py:146: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
print("%f cm = %f inch"(length, length_b))