0 like 0 dislike
ago in Examples, Exercises and Projects by (7k points)

1     *                       2   333

           ***                          313

          *****                        323

        *******                      333

       ******* 

        *****  

        ***   

         *  

1 Answer

0 like 0 dislike
ago by (7k points)
 
Best answer

Sol. 1.

for i in range(8):

    for j in range(7):

        if i==3 or (i==2 and j!=0 and j!=6) or (i==1 and j>=2and j<=4) or (i==0 and j==3):

            print("*",end='')

        elif i==4 or (i==5 and j!=0 and j!=6) or (i==6 and j>=2and j<=4) or (i==7 and j==3):

            print("*",end='')

        else:

            print(" ",end='')

    print(" ")


2.

for i in range(4):

    for j in range(3):

        if i==0 or i==3 or j==0 or j==2:

            print("3",end='')

        else:

            print(i,end='')

    print("")

Register fast for winter training program at Goeduhub Technologies. We are providing winter training in AI-ML, IoT, Python, Hadoop and PLC-SCADA.

[[ CALL - 07976731765 ]]

...