Anasayfa
/
Teknoloji
/
What Will the Following Code Output? for I in Range(5): If I=3 Break Print(i) 0123 012 Error 01234

Soru

What will the following code output? for i in range(5): if i=3 break print(i) 0123 012 Error 01234

Çözüm

4.5 (129 Oylar)
Ferhat
Uzman doğrulaması
Elit · 8 yıl öğretmeni

Cevap

The code will output "1", "2", and "3". The loop will iterate from 0 to 4, and when i equals 3, the if statement will execute the break command, which will exit the loop. Therefore, only the numbers 1, 2, and 3 will be printed.