This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
favorite_music = [ | |
['Нейромонах Феофан', 'В душе драм, в сердце светлая Русь'], | |
['НТР', 'Тыжпрограммист'], | |
['LinDi', '裂帛'], | |
['Yann Tiersen', 'Amelie'], | |
['Баста', 'ЧП'], | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list_size = 0 | |
# memory_size means total memory for this list whithout header memory | |
memory_size = 0 | |
last_memory_size = 0 | |
# if one element takes eight bytes of memory total | |
# then list with 2**20 elements weights 8 megabytes | |
# (it should be true at least for list with several kinds of elements, like True/False or 0/.../9) | |
max_output = 2**20 | |
output1 = 'Visible elements:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
print('ASCII:') | |
for sym in range(128): | |
print(sym, f':c={sym:c}', sep='', end='\t') | |
print('\n\nRandom symbols:') | |
for i in range(100): | |
print(sym := randint(0, 0x11000 // 2), f':c={sym:c}', sep='', end='\t') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
for m in ['', 'd', 'b', 'o', 'x', 'X', 'e', 'E', '%']: | |
template = 'Hello {0}, your balance is {1:=+16' + m + '}:16{2}' | |
print(template.format('Adam', randint(-1000, 1000), m)) | |
print(f'{randint(-1000, 1000):+}') |