May-09-2018, 06:12 AM
You have pretty much figured what the problem is. On line 17, you convert your input to an integer with
length = int(
. But strings cannot be converted to integer. So the error happens before the execution reaches if statement. Removing int() (the conversion) might do the trick. Then it's only a matter of how you want floats to be handled, if user inputs them.