Grid format for python output

565 views Asked by At

I'm trying to print strings into a grid.

The following code gives me the output I expect

    for i in range(5):
        for i in range(5):
            print("|            "),

enter image description here

But now I want to place text in that same format using a function:

    for i in range(5):
        for i in range(5):
            print(getTask(1)),

Where getTask() looks like:

   def getTask(task_number):
      task = "blank"
         one = "| Ride on \n| someone's\n| shoulders\n|"

         if task_number == 1:
             task = one

      return task

But now my output isn't in the grid format

enter image description here

0

There are 0 answers