Oct-02-2019, 12:08 PM
This code fails:
TypeError: can't multiply sequence by non-int of type 'float'
While this works:
Thanks
import math r=input("r=") h=input("h=") V=math.pi*h*r**2 print (V)V=math.pi*h*r**2
TypeError: can't multiply sequence by non-int of type 'float'
While this works:
import math r=3.5 h=9 V=math.pi*h*r**2 print (V)Can someone tell me where the difference lies and how to make the first bit of code work?
Thanks