Python'daki "and" ve "or" her zaman bool türü döndürmüyor
Gönderilme zamanı: 10 Şub 2023, 12:46
Kod: Tümünü seç
print(0 or [] or bool(0)) # false
print(1 or bool(1)) # 1
print(1 and bool(1)) # true
print(bool(1) or 1) # true
print(bool(1) and 1) # 1