Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created June 1, 2021 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/94eaea063f1130820d43d11d85db60f0 to your computer and use it in GitHub Desktop.
Save parzibyte/94eaea063f1130820d43d11d85db60f0 to your computer and use it in GitHub Desktop.
def solicitar_movimiento(movimientos):
while True:
print("Movimientos que puede aprender el pokémon: ")
for indice, movimiento in enumerate(movimientos):
print(f"{indice} - {movimiento}")
indice_movimiento = int(input("Seleccione un ataque a ejecutar: "))
if indice_movimiento < 0 or indice_movimiento > len(movimientos) - 1:
print("Número inválido")
continue
movimiento = movimientos[indice_movimiento]
print(f"El ataque seleccionado es: {movimiento}")
poder_ataque = get_move(normalizar_nombre(movimiento))
if poder_ataque > 0:
return poder_ataque
else:
print("El ataque tiene un poder de 0. Seleccione otro movimiento")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment