Contenido del Curso
Learn Python from Scratch
Learn Python from Scratch
for loop (2/5)
Remember data types we learned previously? for
loop can easily iterate over some of them. For example, you can easily iterate over a string to get all symbols from it.
# iterate over string s = "small string" for i in s: print(i)
Or over list
# iterate over list l = [1, [2,3], 4, "wow"] for i in l: print(i)
The same applies to tuples.
Tarea
Given list people
. Using for
loop, extract every single item from it.
¡Gracias por tus comentarios!
for loop (2/5)
Remember data types we learned previously? for
loop can easily iterate over some of them. For example, you can easily iterate over a string to get all symbols from it.
# iterate over string s = "small string" for i in s: print(i)
Or over list
# iterate over list l = [1, [2,3], 4, "wow"] for i in l: print(i)
The same applies to tuples.
Tarea
Given list people
. Using for
loop, extract every single item from it.
¡Gracias por tus comentarios!
for loop (2/5)
Remember data types we learned previously? for
loop can easily iterate over some of them. For example, you can easily iterate over a string to get all symbols from it.
# iterate over string s = "small string" for i in s: print(i)
Or over list
# iterate over list l = [1, [2,3], 4, "wow"] for i in l: print(i)
The same applies to tuples.
Tarea
Given list people
. Using for
loop, extract every single item from it.
¡Gracias por tus comentarios!
Remember data types we learned previously? for
loop can easily iterate over some of them. For example, you can easily iterate over a string to get all symbols from it.
# iterate over string s = "small string" for i in s: print(i)
Or over list
# iterate over list l = [1, [2,3], 4, "wow"] for i in l: print(i)
The same applies to tuples.
Tarea
Given list people
. Using for
loop, extract every single item from it.