Universe Sandbox

General Category => Everything Else => Topic started by: vh on October 24, 2012, 02:22:23 PM

Title: noffing here
Post by: vh on October 24, 2012, 02:22:23 PM
(not in python thread because you've probably been bored of me posting non-working code 20 times over the past day)

Code: [Select]
import os

def printnumber(number):
    print int(number)

x=1
while x<20:
    printnumber(5)
    printnumber(6)
    x=x+1
    while x<10:
        printnumber(7)
        printnumber(8)


os.system('pause')
        

expected output:

5
6
7
8
5
6
7
8
5
6
7
8
5
6
7
8
.....
and then eventually only
5
6
5
6
5
6
...
and the eventually it stops.

but it just prints 7 and 8 forever. what's wrong?
Title: Re: simple code heeeelp
Post by: vh on October 24, 2012, 02:28:36 PM
OH NEVERMIND I SEE; IT GETS STUCK ON THE while x < 10: loop