İnsanların yarısının yanlış cevapladığı 15 saniyelik kodlama testi

Profil Fotoğrafı Vato -(22.01.2026 17:56:18) 0

Yorumlar:

Bahsettikleri soru
Kod
1
2
3
4
5
6
7
result = 0

for x in [3, 3, 5]:
if x > 3:
result = result - x
else:
result = result + x


Çözüm:

x = 3
3 > 3 False → else çalışır
result = 0 + 3 = 3

x = 3
3 > 3 False → else çalışır
result = 3 + 3 = 6

x = 5
5 > 3 True → if çalışır
result = 6 - 5 = 1

✅ Sonuç: 1

Profil Fotoğrafı Vato -(22.01.2026 18:01:25) 0

Yorumunuz: