Welcome, Guest

Author Topic: noffing here  (Read 1204 times)

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
noffing here
« 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?
« Last Edit: October 24, 2012, 02:32:24 PM by mudkipz »

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: simple code heeeelp
« Reply #1 on: October 24, 2012, 02:28:36 PM »
OH NEVERMIND I SEE; IT GETS STUCK ON THE while x < 10: loop