Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. import math
  2.  
  3. def archimedes (sides):
  4.  
  5. innerangleB = 360.0 / sides
  6. halfangleA = innerangleB / 2
  7.  
  8. onehalfsideS = math.sin(math.radians(halfangleA))
  9.  
  10. sideS = onehalfsideS * 2
  11.  
  12. polygonCircumference = sides * sideS
  13.  
  14. polygonCircumference = sides * sideS
  15. pi = polygonCircumference/2
  16.  
  17. return pi
  18.  
  19. ...and here are the errors:
  20.  
  21. >>> import math
  22. >>>
  23. >>> def archimedes (sides):
  24. ...
  25. File "<stdin>", line 2
  26.  
  27. ^
  28. IndentationError: expected an indented block
  29. >>> innerangleB = 360.0 / sides
  30. File "<stdin>", line 1
  31. innerangleB = 360.0 / sides
  32. ^
  33. IndentationError: unexpected indent
  34. >>> halfangleA = innerangleB / 2
  35. File "<stdin>", line 1
  36. halfangleA = innerangleB / 2
  37. ^
  38. IndentationError: unexpected indent
  39. >>>
  40. >>> onehalfsideS = math.sin(math.radians(halfangleA))
  41. File "<stdin>", line 1
  42. onehalfsideS = math.sin(math.radians(halfangleA))
  43. ^
  44. IndentationError: unexpected indent
  45. >>>
  46. >>> sideS = onehalfsideS * 2
  47. File "<stdin>", line 1
  48. sideS = onehalfsideS * 2
  49. ^
  50. IndentationError: unexpected indent
  51. >>>
  52. >>> polygonCircumference = sides * sideS
  53. File "<stdin>", line 1
  54. polygonCircumference = sides * sideS
  55. ^
  56. IndentationError: unexpected indent
  57. >>>
  58. >>> polygonCircumference = sides * sideS
  59. File "<stdin>", line 1
  60. polygonCircumference = sides * sideS
  61. ^
  62. IndentationError: unexpected indent
  63. >>> pi = polygonCircumference/2
  64. File "<stdin>", line 1
  65. pi = polygonCircumference/2
  66. ^
  67. IndentationError: unexpected indent
  68. >>>
  69. ... return pi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement