sin60 = float(0.866025)
w = float(input('width?'))
a = w / 2
b = a / sin60
c = b / 2
r = ( b / 2 ) + c
print(r/2)
z=input()
It is much easier to use a Python IDE - like IDLEThe weird part is I wrote the code using notepad then changed the ext to .PY after saving it. Clunky but I am learning.
That's the new default on raspberry piAnother Python IDE that is intended for learners is Thonny.
Why should the width of a nut be required to be an integer?Try this way:
Code:sin60=0.866025 print('Width?') w= int(input()) a = w / 2 b = a / sin60 c = b / 2 r = ( b / 2 ) + c print(r)
by Aaron Carman
by Jeff Child
by Jake Hertz