🦄 Tek satır ile yapı oluşturmadır.
🤯 Daha anlaşılır
💨 Daha hızlı
# Verimli Yapısquares = [x**2 for x in range(10)] # Liste tanımlamasquare_lut = {x: x**2 for x in range(10)} # Dict tanımlama# Verimsiz (eski) yapısquares = []square_lut = {}for x in range(10):squares.append(x**2)square_lut[x] = x**2
me_dict_dtypes = {k: type(v) for k, v in me_dict.items()}print(me_dict_dtypes)# {'name': <class 'str'>, 'age': <class 'int'>, 'height': <class 'float'>, 'weight': <class 'float'>, 'hair': <class 'str'>, 'eyes': <class 'str'>, 'has dog': <class 'bool'>, 'favorite color': <class 'str'>, 'nieces/nephews': <class 'int'>}