New game
Download
Get Academic Plan
Share game
Fill in the Blanks
Fill in the Blanks

Ciclo for en Python

Integrate it into your platform

You can integrate the game into an LMS compatible with LTI 1.1 or LTI 1.3 such as Canvas, Moodle, or Blackboard. This way, the scores will be automatically saved into the platform’s gradebook.
Download
You have exceeded the maximum number of games you can integrate into Google Classroom with your current Plan.

To integrate as many games as you want in Google Classroom, you need an Academic Plan or a Commercial Plan.

You have exceeded the maximum number of games you can integrate into Microsoft Teams with your current Plan.

To integrate as many games as you want in Microsoft Teams, you need an Academic Plan or a Commercial Plan.

Downloading games is an exclusive feature for users with an Academic Plan or a Commercial Plan.

Get your Academic Plan or your Commercial Plan now and start integrating your games into your LMS, website or blog.

If you wish, you can download a demo game here and test its integration:

Ciclo for en Python

Fill in the Blanks

(1)
Played 20 %Accuracy 92 Average time 14:51

About this activity

Prueba de for en Python

Created by

Mexico

Download the paper version to play

Make your own free game from our game creator
Compete against your friends to see who gets the best score in this game

Top Games

%
Anonymous
Anonymous
%
%
%
You have exceeded the maximum number of games you can print with your current Plan.

To print as many games as you want, you need an Academic Plan or a Commercial Plan.

Print your game
Ciclo for en Python
 

Fill in the Blanks

Ciclo for en PythonOnline version

Prueba de for en Python

by Gabriel Barron Rodírguez
1

La función range ( 3 ) genera una secuencia que comienza por defecto en 0 y termina en 2 ( el límite superior 3 es exclusivo ) . Cada número se imprime en una línea nueva .

in ( ) :
( )

2

El ciclo for se repite tantas veces como elementos haya en la lista ( 2 veces ) . Como la instrucción interna pide imprimir el texto fijo " hola " , este se repite sin mostrar el nombre de las frutas .

= [ 'manzana' , 'pera' ]
:
( " " )

3

Al pasar dos parámetros a range ( 2 , 5 ) , el primero indica el punto de partida ( inclusivo ) y el segundo el punto de parada ( exclusivo ) .

( , ) :
( j )

4

El tercer parámetro de range define el incremento . El conteo empieza en 1 y avanza de 2 en 2 ( 1 , 3 , 5 ) , deteniéndose antes de alcanzar o superar el 6 .

x ( , , ) :
( )

5

La variable suma acumula los valores en cada vuelta del ciclo ( 1 + 2 + 3 ) . Como la instrucción print ( suma ) no tiene indentación , está fuera del bucle y solo muestra el resultado final .

=
[ , , ] :
suma = suma + n
( suma )

6

En Python , los textos son iterables . El ciclo extrae letra por letra y el método . upper ( ) las transforma a mayúsculas antes de imprimirlas verticalmente .

" " :
( c . ( ) )

7

Un paso negativo ( - 1 ) hace que el ciclo cuente hacia atrás . Comienza en 5 y se detiene justo antes de llegar al límite de 1 .

( , , - ) :
( i )

8

Si una lista no tiene elementos , el cuerpo del ciclo for se pasa de largo por completo y el programa continúa con la siguiente línea disponible sin sangrado .

= [ ]
:
( " Elemento encontrado " )
print ( " " )

9

El ciclo pasa por los números 0 , 1 y 2 , pero la condición if filtra la ejecución , haciendo que el print solo se active cuando i vale exactamente 1 .

for ( 3 ) :
i = = :
( " " )

10

Todas las líneas que comparten la misma indentación pertenecen al ciclo . Por lo tanto , en cada vuelta se ejecutan ambas instrucciones en orden secuencial .

( ) :
print ( " " )
( i )

Are you sure you want to leave the page?

If you leave, you will lose the game in progress.