Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error en: 03 Flip list #129

Open
nunezweb opened this issue Jul 16, 2024 · 0 comments
Open

error en: 03 Flip list #129

nunezweb opened this issue Jul 16, 2024 · 0 comments

Comments

@nunezweb
Copy link

nunezweb commented Jul 16, 2024

Se puede resolver el ejercicio "03 Flip list" de varias maneras, sin embargo según los requerimientos hay que exponer una solución, al no dejarme pasar el test he visto el archivo de la solución y parece estar mal:

1- La solución del archivo del ejercicio indica:

Sample_list = [45, 67, 87, 23, 5, 32, 60]

# Your code below

for i in range(len(sample_list) -1, -1, -1):
    new_list.append(sample_list[i])

print(new_list)

2- Sin embargo Python Lanza un error, intenta usar la lista new_list sin haberla definido previamente:

Sample_list = [45, 67, 87, 23, 5, 32, 60]

new_list = []
for i in range(len(sample_list) -1, -1, -1):
    new_list.append(sample_list[i])
print(new_list)

El ejercicio se ejecuta correctamente y da el resultado esperado, sin embargo no pasa el test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant