Python Program not reasigning variable when if statement run
Go to solution
Solved by fizzlesticks,
The problem is in the line
pi = int(4*(withinone/loop))
withinone and loop are both integers so it does an integer division, which in your case is resulting in 0. To do a floating point division you'll need to cast one or both of those variables to a float. You'll also probably want to remove the int cast.

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now