Я написал код, подобный приведенному ниже:
p=float(input('enter the particle density(g/cm3):'))
g=9.81#gravitation acceleration
pw=1
dp=float(input('enter the diameter of particle in mm:'))
m=float(input('enter the viscocity of the fluid:'))
Vs=(g*(p-pw)*(dp*10**-3)**2)/(18*m)
print("the settling velocity of the particle is"+str(Vs))
Он принимает данные от терминала следующим образом:
[Desktop]$ python3 settling_velocity.py
enter the particle density(g/cm3):2
enter the diameter of the particle in mm:2
enter the viscosity of the fluid:0.89*10**-5
И выдает некоторый результат с python2.7, но когдаЯ запускаю этот код с python3, он показывает ошибку как
Python 3 Error ValueError: could not convert string to float: '0.89*10**-5' ?
Как я могу решить эту проблему, пожалуйста, помогите ..
спасибо