Skip to content

Commit fe23700

Browse files
authored
Merge pull request mouredev#3144 from Marlonleon2023/main
#17-python
2 parents 6719fb2 + 33830af commit fe23700

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""/*
2+
* EJERCICIO:
3+
* Utilizando tu lenguaje, emplea 3 mecanismos diferentes para imprimir
4+
* números del 1 al 10 mediante iteración.
5+
*
6+
* DIFICULTAD EXTRA (opcional):
7+
* Escribe el mayor número de mecanismos que posea tu lenguaje
8+
* para iterar valores. ¿Eres capaz de utilizar 5? ¿Y 10?
9+
*/"""
10+
11+
12+
# con for
13+
print("imprimiendo con for")
14+
for i in range(1,11):
15+
print(i)
16+
17+
# con while
18+
19+
print("imprimiendo con while")
20+
contador=0
21+
22+
while contador<10:
23+
contador+=1
24+
print(contador)
25+
26+
27+
print("imprimiendo print se utiliza la funcion map")
28+
list(map(print, range(1, 11)))

0 commit comments

Comments
 (0)