Need Help? python [on hold]

128
September 13, 2017, at 7:56 PM

Hi Guys in Python I wanted to print the following Pattern using nested loops. Need Help???

                              1
                            2 1 2
                          3 2 1 2 3
                        4 3 2 1 2 3 4
                      5 4 3 2 1 2 3 4 5
                    6 5 4 3 2 1 2 3 4 5 6
                  7 6 5 4 3 2 1 2 3 4 5 6 7

My Code is :

for i in range(1,8,1):
        for y in range(8 - i):
                print(" ", end = " ")
        for y in range(i,0,-1):
                print(y, end =" ")
        for j in range(i - 8):
                print(" ", end = " ")
        for j in range(2,i):
                print(j,end=" ")
        print("\n")
READ ALSO
Efficient way to rotate a 2D array of integers of n size in Python

Efficient way to rotate a 2D array of integers of n size in Python

I want to rotate (anti-clockwise) a 2D nxn array of integers and the 2D array is stored as a list of lists

211
How to monitor the changes remote directories and files?

How to monitor the changes remote directories and files?

I am trying to monitor remote directory and filesI need to store or log the changes i

220
ValueError when using np.vectorize - Where am I going wrong?

ValueError when using np.vectorize - Where am I going wrong?

Here's the question I'm trying to answer

178