Python Taskbook Level 10.1

Задание 1

Ask the user for two numbers. Check whether these numbers are friendly or not.

Задание 2

Here is a list:

pythonlst = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];

Given a variable:

pythonn = 3;

Turn this list into a two-dimensional list, with n elements per sublist.

Задание 3

Given a list:

python[
  [1, 2, 3, 4, 5],
  [1, 2, 3],
  [1, 2],
]

Add enough empty lines to each sublist so that the number of elements in each sublist is equal to the number of elements in the longest sublist.

Задание 4

Given a list of some data for certain dates, stored in the following structure:

pythondata = [
  {
    'year':  2019,
    'month': 11,
    'day': 20,
    'data': ['list with data']
  },
  {
    'year':  2019,
    'month': 11,
    'day': 21,
    'data': ['list with data']
  },
  {
    'year':  2019,
    'month': 12,
    'day': 25,
    'data': ['list with data']
  },
  {
    'year':  2019,
    'month': 12,
    'day': 26,
    'data': ['list with data']
  },
  {
    'year':  2020,
    'month': 10,
    'day': 29,
    'data': ['list with data']
  },
  {
    'year':  2020,
    'month': 10,
    'day': 30,
    'data': ['list with data']
  },
  {
    'year':  2020,
    'month': 11,
    'day': 19,
    'data': ['list with data']
  },
  {
    'year':  2020,
    'month': 11,
    'day': 20,
    'data': ['list with data']
  },
]

Write code that will convert the data structure into a structure like this:

python{
  year1: {
    month1: {
      Day 1: [list of data],
      Day 2: [list of data],
      Day 3: [list of data],
    },
    month2: {
      Day 1: [list of data],
      Day 2: [list of data],
      Day 3: [list of data],
    }
  },
  year2: {
    month1: {
      Day 1: [list of data],
      Day 2: [list of data],
      Day 3: [list of data],
    },
    month2: {
      Day 1: [list of data],
      Day 2: [list of data],
      Day 3: [list of data],
    }
  }
}