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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started