data = {
'user': [
{'name': 'Alex', 'age': 18},
{ 'name': 'Jack', 'age': 23},
{'name': 'Anna', 'age': 17}
]
}
# Способ 1
names = []
for user in data['user']:
names.append(user['name'])
print(names)
# Способ 2
names = [user['name'] for user in data['user']]
print(names)
# Способ 3
names = list(map(lambda x: x['name'], data['user']))
print(names)
# Выбирайте, какой вам больше по душе
from Crypto.Util import number
number.getPrime(2048)
text=bytes()
i=0
while i<=len(rawtext)-1:
if rawtext[i]==187 and rawtext[i-1]!=208:
text+=bytes([32])
elif rawtext[i]==171 and rawtext[i-1]!=208:
text+=bytes([32])
else:
text+=bytes([rawtext[i]])
i+=1
return(text.decode('utf-8', 'ignore'))