0

Is it true loops always give the sorted structure output

b = ["y", "b", "n"] for i in b: if len(b) == 3: print(len(b)) output: 3 3 3

29th Sep 2017, 1:59 PM
adito alfatah
adito alfatah - avatar
1 ответ
0
No, but it's easy if you use sorted command on the list and after that using loop will give the sorted list 100% allways
30th Sep 2017, 4:35 PM
Ismail Zam Zam
Ismail Zam Zam - avatar