My Coding Quiz #58

in Indiaunited17 days ago

My Coding Quiz #58 👨‍💻🛠️🧩

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...




Quiz
By @eniolw


What's your choice?

Solution to the previous quiz: {'Sicilian', 'Caro Kann'} These are names of chess openings. We see that in the script we define two variables that are really sets: Karpov and Kasparov. Both sets have two string elements each, with the name of chess openings as we said.

The fun fact is revealed by obtaining the variable what with what = Karpov ^ Kasparov. What value will take what? Well, the operator ^ applied to sets represents the asymmetric difference operation, that is, the set of elements that are in one of the sets, but not in both. These would be the unique elements.

In our example, both Karpov and Kasparov have in common the Queen's Gambit opening, but not so with the Caro Kann and the Sicilian, so the latter integrate the new set obtained. Did you know this set operation? It is incredibly useful and any trained computer scientist should know it.


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 and others.


Mi Quiz de Programación #58 👨‍💻🛠️🧩

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...




Quiz
Por @eniolw


¿Cuál es tu elección?

Solución al quiz anterior: {'Sicilian', 'Caro Kann'}. Estos son nombres de aperturas de ajedrez. Vemos que en el script definimos dos variables que realmente son conjuntos: Karpov y Kasparov. Ambos conjuntos tienen dos elementos string cada uno, con el nombre de aperturas de ajedrez como decíamos.

El dato curioso se revela al obtener la variable what con what = Karpov ^ Kasparov. ¿Qué valor tomará what? Bueno, el operador ^ aplicado a conjuntos representa la operación de diferencia asimétrica, es decir, el conjunto de elementos que están en uno de los conjuntos, pero no en ambos. Estos serían los elementos únicos.

En nuestro ejemplo, tanto Karpov como Kasparov tienen en común la apertura del Gambito de Dama (Queen's Gambit), pero no así con la Caro Kann y la Siciliana (Sicilian), por lo que estas últimas integran el nuevo conjunto obtenido. ¿Conocías esta operación sobre conjuntos? Es increíblemente útil y cualquier informático capacitado debería saberlo.


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 y otras.

Sort:  

Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support. 
 

Congratulations @eniolw! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You have been a buzzy bee and published a post every day of the week.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

LEO Power Up Day - May 15, 2024

Saludos
@tipu curate 8

Gracais!