My Coding Quiz #32 👨💻🛠️🧩
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...

By @eniolw
What's your choice?
Solution to the previous quiz: stem. First we create a string base
that has several unintelligible characters, but that doesn't matter. Line 2 converts them into a list using the powerful Python list comprehension mechanism. That list in turn is transformed into a set in line 3 using the set
constructor. A set is, simply put, an unordered collection of unique elements.
In our case, the set a
will be formed by all the characters in base
, noting that as the character 'h' is duplicated in base
, it will not be duplicated in a
, since sets do not have duplicates by definition.
Then, line 4 presents the difference operation that applies to two sets. We see that it applies to a
and b
. The way to read that instruction is which elements are in a
that are not in b
. We have that:
a = {'m', 'c', 'e', 'n', 'a', 'h', 't', 's', 'i'}
And
b = {'c', 'n', 'h', 'a', 'i'}
The difference a - b
is the set:
c = {'s', 'm', 't', 'e'}
The object returned by difference
is a new set. In the final line, the set c
is converted to a list and then converted to a string using join
. What is printed is an anagram of 'stem', that is, a word with the same letters that stem has.
Enthusiast @gabrielr29 came up with the right answer. Congratulations.
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 #32 👨💻🛠️🧩
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...

Por @eniolw
¿Cuál es tu elección?
Solución al quiz anterior: stem. Primero creamos una cadena base
que tiene varios caracteres ininteligibles, pero eso no importa. La línea 2 los convierte en una lista utilizando el poderoso mecanismo de comprensión de listas de Python. Esa lista a su vez se transforma en un conjunto en la línea 3 usando el constructor set
. Un conjunto es, en pocas palabras, una colección desordenada de elementos únicos.
En nuestro caso, el conjunto a
estará formado por todos los caracteres de base
, teniendo en cuenta que como el carácter 'h' es duplicado en base
, no se duplicará en a
, ya que los conjuntos no tienen duplicados por definición.
Luego, la línea 4 presenta la operación de diferencia que se aplica a dos conjuntos. Vemos que se aplica a a
y b
. La forma de leer esa instrucción es qué elementos están en a
y no en b
. Tenemos que:
a = {'m', 'c', 'e', 'n', 'a', 'h', 't', 's', 'i'}
Y
b = {'c', 'n', 'h', 'a', 'i'}
La diferencia a - b
es el conjunto:
c = {'s', 'm', 't', 'e'}
El objeto devuelto por difference
es un conjunto nuevo. En la línea final, el conjunto c
se convierte en una lista y luego se convierte en una cadena usando join
. Lo que está impreso es un anagrama de 'stem', es decir, una palabra con las mismas letras que tiene stem.
El entusiasta @gabrielr29 dio con la respuesta correcta. Felicitaciones.
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.