Python Taskbook Level 10.8

Задание 1

Write a code that will check the complexity of the password. Come up with the complexity criteria yourself.

Задание 2

Given a list, output to the console all possible permutations of the elements of this list.

Задание 3

Print a list of all amicable numbers in a given range.

Задание 4

Let the file store JSON of cities of the following type:

cities.json{
  [
    "id": "1",
    "city": "city1",
    "country": "country1",
  ],
  [
    "id": "2",
    "city": "city2",
    "country": "country1",
  ],
  [
    "id": "3",
    "city": "city3",
    "country": "country2",
  ]
}

Let the file store JSON of countries in the following format:

countries.json{
  [
    "id": "1",
    "country": "country1",
  ],
  [
    "id": "2",
    "country": "country2",
  ],
  [
    "id": "3",
    "country": "country3",
  ]
}

Write a script that will substitute id countries instead of countries:

cities.json{
  [
    "id": "1",
    "city": "city1",
    "country_id": "1",
  ],
  [
    "id": "2",
    "city": "city2",
    "country_id": "1",
  ],
  [
    "id": "3",
    "city": "city3",
    "country_id": "2",
  ]
}