floating point – TypeError: a float is required – Python

floating point – TypeError: a float is required – Python

Youre passing string variables to math.sin and math.asin, which is causing the type error. You can fix by converting to float:

ang = format(math.asin(float(side_b)* (math.sin(float(angle_a))/float(side_a))),.3f)

You could also just store all these variables as floats to begin with.

floating point – TypeError: a float is required – Python

Related posts

Leave a Reply

Your email address will not be published. Required fields are marked *