Код: Выделить всё
a = ['a', 'b', 'c', 'd']
list_comprehension = [v for v in a]
my_f_string = f"dict comprehension {v:None for v in a}"
Подробнее здесь: https://stackoverflow.com/questions/694 ... n-f-string
Код: Выделить всё
a = ['a', 'b', 'c', 'd']
list_comprehension = [v for v in a]
my_f_string = f"dict comprehension {v:None for v in a}"