Populating Multidimensional Lists in Python

Using loops, you can populate multidimensional lists with elements.

Let's say we need to get the following two-dimensional list:

python[
  [1, 2, 3],
  [1, 2, 3],
]

We will solve the problem by using two nested loops. The outer loop will create sublists, and the inner loop will fill these sublists with numbers:

pythonlst = []

for i in range(0, 2):
  sub_lst = [] # create a sublist
  
  for j in range(1, 4):
    sub_lst.append(j) # fill the sublist with numbers
    lst.append(sub_lst)
Задание 1

Use loops to fill the list with the following data:

python[
  [1, 2, 3],
  [1, 2, 3],
  [1, 2, 3],
]
Задание 2

Two lists are given:

pythonlst1 = []
lst2 = ['a', 'b', 'c']

Using loops, fill the first list with the elements of the second list to get the following result:

python[
  ['a', 'b', 'c'],
  ['a', 'b', 'c'],
]