TypeError: can not multiply sequence by non-int of type 'float'

0

How do I fix that error?

Traceback (most recent call last):

File "main.py", line 7, in

AreaL = (PI *(Generatriz * Radio))

TypeError: can not multiply sequence by non-int of type 'float'

import math
PI =  3,1415
Diametro = int (raw_input("Ingrese el diametro del cono: \n"))
Profundidad = int (raw_input("Ingrese la profundidad del cono: \n"))
Radio = Diametro/2
Generatriz = math.sqrt(pow(Profundidad,2)+pow(Radio,2))
AreaL = (PI *(Generatriz * Radio))
AreaTotal = AreaL + (PI * (pow(Radio,2)))
Volumen = (PI * pow(Radio,3) * Profundidad)/3
if Volumen < 200.000:
   print "El deposito no es viable pues su volumen es %d metros cuadrados"% Volumen
if Profundidad < 20 or Profundidad > 250:
   print "El deposito no es viable pues tiene profundidad inadecuada"
if AreaTotal < 10.000:
   print "El deposito no es viable pues la base tiene area insuficiente: %f metros cuadrados"% AreaTotal    
else:
   print "El deposito es viable con volumen metros cubicos"% Volumen 
    
asked by Wolf 19.09.2018 в 06:42
source

1 answer

0

There are 2 errors, the first PI = 3,1415 (Replace the comma with dot 3.1415 )

And the second, in else

print "El deposito es viable con volumen metros cubicos"% Volumen

missing% d (or% f) within the chain.

print "El deposito es viable con volumen %f metros cubicos"% Volumen
    
answered by 19.09.2018 в 07:43