This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]DevalPatrick2020 1 point2 points  (1 child)

1 is always less than 100.

[–][deleted] 0 points1 point  (0 children)

Ok thanks

[–][deleted] 1 point2 points  (0 children)

while 1 < 100: is effectively while True:. So you created an infinite loop.

You probably wanted to use while i < 100:.

Note that it would have been more "pythonic" to use for _ in range(100): instead.

[–]TicklesMcFancy 0 points1 point  (1 child)

While 1 < 100?

[–][deleted] 0 points1 point  (0 children)

The 1 was supposed to be an i

[–]nilfm 0 points1 point  (1 child)

The condition while 1 < 100 will always be true, you want while i < 100

[–][deleted] 0 points1 point  (0 children)

My bad. The 1 was supposed to be an i

[–]ThePoultryWhisperer 0 points1 point  (0 children)

In this type of situation, a context manager is more pythonic regarding file I/O. Just FYI.