Conteúdo do Curso
Introduction to Python
3. Conditional Statements
Introduction to Python
Iterating Over Indexes
Keep in mind that the range()
function needs at least one argument. Since indexing in Python begins at 0
, you can use the length of the sequence as the sole argument for the range()
function.
To determine the length of a sequence, employ the len()
function. For example, you can loop through the list from earlier sections, but this time by its indices.
At each iteration of the loop, the variable i
sequentially traverses the indices of values
, ranging from 0
to 3
.
Tudo estava claro?
Conteúdo do Curso
Introduction to Python
3. Conditional Statements
Introduction to Python
Iterating Over Indexes
Keep in mind that the range()
function needs at least one argument. Since indexing in Python begins at 0
, you can use the length of the sequence as the sole argument for the range()
function.
To determine the length of a sequence, employ the len()
function. For example, you can loop through the list from earlier sections, but this time by its indices.
At each iteration of the loop, the variable i
sequentially traverses the indices of values
, ranging from 0
to 3
.
Tudo estava claro?