Printing pattern with Python programming

Python patterns programs

Write a Python program to print pattern like.
(for code, Scroll down)


1. Write a Python program to print like
****
****
****
****

for i in range(4):

    for j in range(4):
        print("*",end="")
    print(" ")

2. Write a Python program to print like
1111
2222
3333
4444


for i in range(1,5):
    for j in range(4):
        print(i,end="")
    print(" ")

3. Write a Python program to print like
4444
3333
2222
1111

for i in reversed(range(1,5)):
    for j in reversed(range(1,5)):
        print(j,end="")
    print(" ")

4. Write a Python program to print like
1234
1234
1234
1234


for i in range(1,5):
    for j in range(1,5):
        print(j,end="")
    print(" ")


Comments

Post a Comment

Popular posts from this blog

Invalid syntax , perhaps you forgot a comma? Error in Python

MAD Project (Mobile Android Application Development)

Interview/Exam Questions on List in Python.