Python para principiantes N040 Ejercicios Resueltos N141 al N145

Cordiales Saludos

python_300_fondoblanco.png

Sirva esta publicación para que te animes a entrar al maravilloso mundo de la programación. De la mano de uno de los Lenguajes de programación más populares del momento: Python

Aprendiendo Python

Ejercicios resueltos del 141 al 145

Ejercicios de FOR (para)/ Contadores

# Ejercicio resuelto N141
print()
print("-"*44)
print("Programa N141: Generar: 1 2 3 4 5 6 7 8 9 10")
print("-"*44)

n = 0
for i in range(1,11):
    n = n + 1
    print(n, end = " ")
print()


separador001.png

# Ejercicio resuelto N142
print()
print("-"*44)
print("Programa N142: Generar: 10 9 8 7 6 5 4 3 2 1")
print("-"*44)

n = 11
for i in range(1,11):
    n = n - 1
    print(n, end = " ")
print()


separador001.png

# Ejercicio resuelto N143
print()
print("-"*44)
print("Programa N143: Generar: 1 4 2 3 3 2 4 1")
print("-"*44)

asc = 0
des = 5
for i in range(1,5):
    asc = asc + 1
    des = des -1
    print(asc,des,"",end = "")
print()
print("Segunda forma")
des = 5
for i in range(1,5):
    des = des -1
    print(i,des,"",end = "")
print()    
print("Tercera forma")
print()
asc = 0
for i in range(4,0,-1):
    asc = asc + 1
    print(asc,i,"",end = "")


separador001.png

# Ejercicio resuelto N144
print()
print("-"*44)
print("Programa N144: Generar: 1 2 3 x 5 6 7")
print("y contar los numeros colocados y cuantas letras")
print("-"*44)
contarLetras = 0
contarnNumeros = 0
x = ' '
for i in range(1,8):
    if i == 4:
        print('x',end = " ")
        contarLetras = contarLetras + 1
    else:
        print(i,'',end = "")
        contarnNumeros = contarnNumeros + 1
print()
print("Se colocaron: ", contarnNumeros, "Numeros")
print("Se coloco: ", contarLetras, "Letra")
print()


separador001.png

# Ejercicio Resuelto N145 de Pythoncumanes
# Tema: Contadores
print()
print("-"*44)
print("Programa N145: Generar: 1 2 3 4 5 4 3 2 1 ")
print("-"*44)
yo_cambio = 0
for i in range(1,10):
    if i <= 5:
        yo_cambio = yo_cambio + 1
        print(yo_cambio,'',end = "")
    else:
        yo_cambio = yo_cambio - 1
        print(yo_cambio,'',end = "")


separador001.png

OBSERVACION

Estos Ejercicios no me los sé de memoria, no hace falta (Sirven para desarrollar la lógica). Los realicé analizando cado uno, disfruté haciendo el 144 y el 145. Es recomendable el uso del lápiz y papel para hacer las series y ver el comportamiento


separador001.png

print("-"*44)
print("BONUS: Generar: 5 4 3 2 1 2 3 4 5 ")
print("-"*44)
yocambio = 6
for i in range(1,10):
    if i <= 5:
        yocambio = yocambio - 1
        print(yocambio,'',end = "")
    else:
        yocambio = yocambio + 1
        print(yocambio,'',end = "")


separador001.png

Puedes practicar en la web https://repl.it/ (debes registrarte) allí podras guardar todos tus ejercicios. Tanto los del curso como los que tu inventes!. Si tienes alguna duda, contáctame.


separador001.png

Entrega anterior

Python para principiantes N039 Contadores y Acumuladores

Puedes practicar en esta web: PythonCumanés


separador001.png

Clases gratis de programación / Free programming classes

[ESP/ENG] Mi proyecto en Python/My project in Python.

Mi twitter
separador001.png


I started a Ko-fi Page! Ko-fi helps creators get support from fans of their work. Please support or follow my page! If you like what I do and feel in tune with my work in creating content for free programming courses and chess publications without any profit interest. Give me a coffee... I will be very grateful!
separador001.png
Todos a programar!
Rafael Aquino

Sort:  

Si estudio 3-4 horas al día, ¿cuánto tiempo me tomará hacer una dApp de ajedrez?

A ese ritmo de estudio podrás hacer cualquier proyecto de App en poco tiempo. Aun no he indagado en el desarrollo movil, pero existen muchos Frameworks: Flutter, Ionic, React Native,etc. Investiga un poco acerca de ellos! Gracias por pasar por aquí y comentar.

мне сложно определить с чего начать обучение. В результате дАпп должен быть смесью ecency и chess.com, ориентированной на интерактив и чаты с ежедневно обновляемым списком настольных игрMe resulta difícil determinar por dónde empezar a aprender. Como resultado, la dApp debería ser una mezcla de ecency y chess.com centrada en interactivos y chats con una lista actualizada diariamente de juegos de mesa.

!PIZZA * !LOL тіљки не зараз !HUG

  • !PIZZA * !LOL * !luv для чого
  • !PIZZA * !LOL * !luv познави себо саме

@pereu4ivatel, @antipops(4/5) sent LUV. | connect | community | HiveWiki | NFT | <>< daily

Join in Hive General chat | Type ! help (no space) to get help on Hive. Info

Made with LUV by crrdlx

Yesterday a clown held a door open for me.
I thought it was a nice jester.

Credit: reddit
@pereu4ivatel, I sent you an $LOLZ on behalf of antipops

(4/6)
Farm LOLZ tokens when you Delegate Hive or Hive Tokens.
Click to delegate: 10 - 20 - 50 - 100 HP

@gravitcaper, @pereu4ivatel(3/4) sent LUV. | connect | community | HiveWiki | NFT | <>< daily

Join in Hive General chat | Type ! help (no space) to get help on Hive. Info

Made with LUV by crrdlx

If you ever get the chance to go to India
You have to try their New Delhi

Credit: reddit
@gravitcaper, I sent you an $LOLZ on behalf of pereu4ivatel

(3/6)
Delegate Hive Tokens to Farm $LOLZ and earn 110% Rewards. Learn more.

Dear @pereu4ivatel, you just got hugged.
I sent 1.0 HUG on behalf of @gravitcaper.
(2/3)

I know a woman who owns a taser.
She is stunning.

Credit: reddit
@pereu4ivatel, I sent you an $LOLZ on behalf of @gravitcaper

(4/4)
ENTER @WIN.HIVE'S DAILY DRAW AND WIN HIVE!

PIZZA!

$PIZZA slices delivered:
@gravitcaper(1/5) tipped @antipops
pereu4ivatel tipped gravitcaper
antipops tipped pereu4ivatel
gravitcaper tipped pereu4ivatel