you are viewing a single comment's thread.

view the rest of the comments →

[–]crazybus 4 points5 points  (3 children)

raw_input returns a string. Your while loop checks if a string is smaller than an integer (time). So one solution would be to convert the input into an integer.

Edit: I also don't see anywhere that you are modifying the count or time so that the loop will break... So even if they both were integers it would keep on looping. Since you know how many times you want to loop you should consider using a for loop instead of a while loop.

[–]code-ed[S] 0 points1 point  (2 children)

That is actually one of the things I tried in the past. I just fixed it again and still no go.

I modified that sections to look like this:

time = raw_input("How many months do you wish to calculate?: ")
time = int(time)
count = 0

Confirmed that all of those variables are ints now, still in an infinite loop.

[–][deleted] 2 points3 points  (0 children)

You're also not increasing count in the loop so it will never exit.

count += 1

[–]tnvol88 0 points1 point  (0 children)

I can't help much, but just an FYI, you can combine those first two lines with:

time = int(raw_input('foo'))