My Coding Quiz #4 👨💻🛠️🧩
Welcome to the new installment of my series of Coding Quizzes, in which you will be able to test your knowledge and skills about programming and software development in a simple and fun way. If you want to learn more about it visit my blog here on Hive and the first post where I introduced it.
Without further ado, here's the riddle...

What's your choice?
Solution to the previous quiz: None, [-1, 4, 6]. In line 1 a list of numerical elements (a = [6, 4, -1]) is created and the same happens in line 2 (a = [1, 0]); nothing special so far.
Line 3 is where the heart of the matter lies. It contains: print(b.sort(), sorted(a)). The sort method is built-in to Python lists and what it does is to modify the list itself, in this case the one referenced with the identifier b. This function returns None. In contrast, the built-in sorted function returns a new list from an iterable. That is what differentiates the two functions. You probably knew it, because the previous post talked about it too. So None, [-1, 4, 6] is the expected output.
If you want to blog about computer science and programming content, I invite you to join Hive and participate in its communities, such as STEM-social, Develop Spanish, Programming & Dev, Hive Learners and others.
Mi Quiz de Programación #4 👨💻🛠️🧩
Bienvenido a mi nueva serie de Quizzes de Programación, en la cual podrás poner a prueba tus conocimientos y habilidades sobre programación y desarrollo de software de una manera sencilla y divertida. Si quieres aprender más sobre ella visita mi blog aquí en Hive y el primer post donde la presenté.
Sin más preámbulos, he aquí el acertijo...

¿Cuál es tu elección?
Solución al quiz anterior: None, [-1, 4, 6]. En la línea 1 se crea una lista de elementos numéricos (a = [6, 4, -1]) y lo mismo ocurre en la línea 2 (a = [1, 0]); nada especial hasta ahora.
La línea 3 es la que contiene la esencia del asunto. Esta contiene: print(b.sort(), sorted(a)). El método sort está integrado en las listas de Python y lo que hace es modificar la propia lista, en este caso aquella referenciada con el identificador b. Esa función retorna None. Por el contrario, la función integrada sorted retorna una nueva lista a partir de un iterable. Eso es lo que diferencia a ambas funciones. Probablemente lo sabías, pues además el anterior post hablaba de ello también. De tal modo que None, [-1, 4, 6] es la salida esperada.
Si quieres bloguear sobre contenido informático y de programación, te invito a unirte a Hive y participar en sus comunidades, tales como STEM-social, Develop Spanish, Programming & Dev, Hive Learners y otras.