Question: Create a python function that takes in a 2d list and prints out the 2d list horizontally so say I have a 2d list like
Create a python function that takes in a 2d list and prints out the 2d list horizontally
so say I have a 2d list like this [[' ', 'L', 'L', 'L', ' '], ['B', '.', '.', '.', 'T'], ['B', '.', '.', '.', 'T'], ['B', '.', '.', '.', 'T'], [' ', 'R', 'R', 'R', ' ']]
and when I run the function print_rec(2d_list):
I want the 2d list to be printed out to the console and display like this
TTT
L...R
L...R
L...R
BBB
and also I want a function that returns a 2d list that when the function is run build_2dlist(wid,hei)
and the function would return the list [[' ', 'L', 'L', 'L', ' '], ['B', '.', '.', '.', 'T'], ['B', '.', '.', '.', 'T'], ['B', '.', '.', '.', 'T'], [' ', 'R', 'R', 'R', ' ']]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
