WHILE LOOP, This loop repeats a block of code as long as a given condition is True., Ideal for situations where the number of iterations is unknown beforehand., The loop may not execute at all if the condition is initially false., It can potentially run forever if the condition never becomes false (infinite loop)., The loop’s condition is checked before each iteration., It’s useful for reading data until a sentinel value (like "done") is entered., FOR LOOP, It is commonly used to iterate over each item in a list, string, or range., Often used with the range() function to repeat code a specific number of times., It processes each element in a sequence (e.g., list, tuple) one by one., Typically uses a counter or index variable that increments or decrements., Best choice when you need to repeat a block of code a fixed number of times., NESTED LOOP, This structure contains one loop inside another loop., Useful for creating patterns like triangles or grids using stars or numbers., Often used for tasks like matrix operations or multi-dimensional data., It can be used to traverse through rows and columns in a table-like structure..
0%
Speed Sorting Description Activity: Loop Lightning Sort!
Kongsikan
Kongsikan
Kongsikan
oleh
Epssabangan
G7
ICT
Computer
Basic programming
Python
Looping
Edit Kandungan
Cetakan
Benamkan
Lebih lagi
Tugasan
Papan mata
Paparkan banyak
Paparkan sedikit
Papan mata ini berciri peribadi pada masa ini. Klik
Kongsikan
untuk menjadikannya umum.
Papan mata ini telah dilumpuhkan oleh pemilik sumber.
Papan mata ini dinyahdayakan kerana pilihan anda berbeza daripada pemilik sumber.
Pilihan untuk Kembali
Pengisihan kelajuan
ialah templat terbuka. Ia tidak menjana skor untuk papan mata.
Log masuk diperlukan
Gaya visual
Fon
Langganan diperlukan
Pilihan
Tukar templat
Paparkan semua
Lebih banyak format akan muncul semasa anda memainkan aktiviti.
Buka keputusan
Salin pautan
Kod QR
Padam
Pulihkan autosimpan:
?