Question: I am trying to teach myself python using interactivepython.org. I have come across a problem that I can not figure out. I have the slope and the spacing correct. I need it to print one less number every time. Could anybody help a newbie out?...

The code I have written:

```
numLines = 10

for i in range(numLines):

    for k in range(i):
        print(' ', end = ' ')

    for j in range(1, numLines):
        print(j, end = ' ')

    print()

    print(" ")

```

Prints:

```
1 2 3 4 5 6 7 8 9 

  1 2 3 4 5 6 7 8 9 

    1 2 3 4 5 6 7 8 9 

      1 2 3 4 5 6 7 8 9 

        1 2 3 4 5 6 7 8 9 

          1 2 3 4 5 6 7 8 9 

            1 2 3 4 5 6 7 8 9 

              1 2 3 4 5 6 7 8 9 

                1 2 3 4 5 6 7 8 9 

                  1 2 3 4 5 6 7 8 9

```

Want to Print:

```
0 1 2 3 4 5 6 7 8 9

  0 1 2 3 4 5 6 7 8

    0 1 2 3 4 5 6 7

      0 1 2 3 4 5 6

        0 1 2 3 4 5

          0 1 2 3 4

            0 1 2 3

              0 1 2

                0 1

                  0

```

Answer: 
How about this

```
numLines = 10
for i in range(numLines):
    print "".join ("  " for j in range(i)) + " ".join (str(j) for j in range(numLines - i))

```

**Output**

```
0 1 2 3 4 5 6 7 8 9
  0 1 2 3 4 5 6 7 8
    0 1 2 3 4 5 6 7
      0 1 2 3 4 5 6
        0 1 2 3 4 5
          0 1 2 3 4
            0 1 2 3
              0 1 2
                0 1
                  0

```
Never mind I figured it out. I had to decrement numLines by one inside the first for loop.