Skip to content

Instantly share code, notes, and snippets.

@bennuttall
Last active September 19, 2016 15:31
Show Gist options
  • Select an option

  • Save bennuttall/950151f56cc2c353e2a325e76ea86b9d to your computer and use it in GitHub Desktop.

Select an option

Save bennuttall/950151f56cc2c353e2a325e76ea86b9d to your computer and use it in GitHub Desktop.
n = 1.0 # start at n=1
i = 0 # counter
while n > 0:
i += 1 # increment counter
n /= 2 # half n on every iteration
print(i) # will this line ever be reached? if so, what will it print?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment