Python Taskbook Level 7.6

Задание 1

Given a text file. Get the percentage of each character. Write the result to a new file.

Задание 2

The file contains Russian text. Open this file, convert the text to transliteration and write it to a new file.

Задание 3

Given a text file, shuffle the lines in this file in random order.

Задание 4

Get a list of all possible lucky tickets. A ticket is a string of six digits, possibly with leading zeros. A ticket is lucky if the sum of the first three digits equals the sum of the second three digits. Write the resulting list to a file, each ticket on a new line.

Задание 5

Write a program that will generate the following list:

python[
  'x',
  'xx',
  'xxx',
  'xxxx',
  'xxxxx',
]
Задание 6

The following dictionary is given:

pythonlst = {
  2018: {
    11: {
      29: [1, 2, 3],
      30: [4, 5],
    },
    12: {
      30: [6, 7],
      31: [8, 9],
    },
  },
  2019: {
    12: {
      29: [10, 11],
      30: [12, 13],
      31: [14, 15],
    }
  },
}

Write all the elements of this dictionary into a new list, like this:

python[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]