跳到主要内容

Iteration — loops

English

Count-controlled loops

  • Iteration means repeating steps.
  • A count-controlled loop repeats a fixed number of times.
  • In Python that is for i in range(n):.

range(1, 5) gives four passes: i is 1, 2, 3, then 4

讲义

登录或创建账户

IGCSE, A-Level & AP