Two questions.

1) isnt Pi just equal to 22/7? Dont think the question is very relevant to the problem, just wanted to confirm that.

2) are you getting an index out of bounds error? Because you...