>>>
>>> [a for a in range(2,11,2) ]
[2, 4, 6, 8, 10]
>>> [a for a in range(2,11,2) if a>4]
[6, 8, 10]
>>> [a**2 for a in range(2,11,2) if a>4]
[36, 64, 100]
>>>
>>>
>>> [a for a in range(2,11,2) ]
[2, 4, 6, 8, 10]
>>> [a for a in range(2,11,2) if a>4]
[6, 8, 10]
>>> [a**2 for a in range(2,11,2) if a>4]
[36, 64, 100]
>>>
>>> l=[a for a in l if a not in ['Casa',0]]
>>> l
['Television', 10, 'Pistola']
>>> l=[a for a in l if a not in ['Casa',0]]
>>> l
['Television', 10, 'Pistola']
>>> def http(e):
... match e:
... case 400:
... print('Error 400')
... case 401:
... print('Auth request')
... case _:
... print('Unknow error')
...
>>> http(12)
Unknow error
>>> http(500)
Unknow error
>>> http(400)
Error 400
https://platform.openai.com/docs/guides/realtime-websocket?websocket-examples=python
>>> users
{'Hans': 'active', 'Éléonore': 'inactive', '景太郎': 'active'}
>>> [a for a in users.keys() if users.get(a)=='active']
['Hans', '景太郎']
>>> r
{'Name': 'Ambiorix', 'age': 34}
>>> {r[a]:a for a in r if type(r[a])==int}
{34: 'age'}
>>> {r[a]:a for a in r if type(r[a])==str}
{'Ambiorix': 'Name'}
>>>
>>>
>>> answer
'Ambiorix Rodriguez Placencio'
>>> chr(max({a:ord(a) for a in answer}.values()))
'z'
>>> chr(max({a:ord(a) for a in answer}.values()))