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: 
Well, The above answers are perfectly fine. But this is my way of doing things... :)

Code:

```
l = map(str,range(0,10))
for i in range(10):
    print ' '.join(l[:len(l)-i]).rjust(20)  

```

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  

```

Hope this helps :)
Try this:

```
numLines = 10

for i in range(numLines, 0, -1):
    for j in range(0, numLines - i):
        print " ",
    for k in range(0, i):
        print k,
    print

```