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 with space between each character. 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 'F U N' which will print out in vertical order.
#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 row<3) or (row==3 and (col==1 or col==5)) or (row==4 and col>1 and col<5):
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<5)):
print("N",end="")
else:
print(end=" ")
print()