Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: Print pattern 'FUN' using Python

golfnut1400:

I need to display the following 'FUN' using patterns in Python. The problem I am having is that I need to have them all on a single line. I do understand when I use print() function that it will move to the next line. I tried searching for an example but was not successful.

Below is my code for 'FUN'


#Pattern F
for row in range(5):
for col in range(7):
if (col==0 or col==1) or ((row==0 or row==2)):
print("F",end="")
else:
print(end=" ")
print()
print()

#Pattern U
for row in range(5): # there are 5 rows
for col in range(7): # 7 columns
if ((col==0 or col==6) and row1 and col print("U", end="")
else:
print(end=" ")
print()

print()


# Pattern N
for row in range(5):
for col in range(9):
if (col==0 or col==1 or col==6 or col==7) or (row==col-1): #and (col>0 and col print("N",end="")
else:
print(end=" ")
print()



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: Print pattern 'FUN' using Python

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×