create account

My Coding Quiz #32 by eniolw

View this thread on: hive.blogpeakd.comecency.com
· @eniolw ·
$8.48
My Coding Quiz #32
<div class="text-justify">

<center><h2>My Coding Quiz #32 👨‍💻🛠️🧩</h2></center>

<p>Welcome to the new installment of my series of <b>Coding Quizzes</b>, 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 <a href="/@eniolw">my blog</a> here on Hive and the <a href="/@eniolw/my-coding-quiz-1">first post</a> where I introduced it.</p>

<h3>Without further ado, here's the riddle...</h3>

<br>
<center>
<img src="https://images.ecency.com/DQmeBxSEidpA2NeX4w8etxfTzZt6XWSFdqGhyycZohcVAbv/quiz_img_en.png" alt="Quiz">
<h6>By @eniolw</h6>
</center>

<br><center><h3>What's your choice?</h3></center>

<p><b>Solution to the <a href="/@eniolw/my-coding-quiz-31">previous quiz</a>:</b> <b>stem</b>. First we create a string <code>base</code> 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 <code>set</code> constructor. A set is, simply put, an unordered collection of unique elements.</p>

<p>In our case, the set <code>a</code> will be formed by all the characters in <code>base</code>, noting that as the character <b>'h'</b> is duplicated in <code>base</code>, it will not be duplicated in <code>a</code>, since sets do not have duplicates by definition.</p>

<p>Then, line 4 presents the difference operation that applies to two sets. We see that it applies to <code>a</code> and <code>b</code>. The way to read that instruction is which elements are in <code>a</code> that are not in <code>b</code>. We have that:</p>

<pre><code>a = {'m', 'c', 'e', 'n', 'a', 'h', 't', 's', 'i'}</code></pre>

And 

<pre><code>b = {'c', 'n', 'h', 'a', 'i'}</code></pre>

The difference <code>a - b</code> is the set:

<pre><code>c = {'s', 'm', 't', 'e'}</code></pre>

<p>The object returned by <code>difference</code> is a new set. In the final line, the set <code>c</code> is converted to a list and then converted to a string using <code>join</code>. What is printed is an anagram of <b>'stem'</b>, that is, a word with the same letters that stem has.</p>

<p>Enthusiast @gabrielr29 came up with the right answer. Congratulations.</p>

<hr>

<p>If you want to blog about computer science and programming content, I invite you to join <a href="/">Hive</a> and participate in its communities, such as <a href="/created/hive-196387">STEM-social</a>, <a href="/created/hive-154226">Develop Spanish</a>, <a href="/created/hive-169321">Programming & Dev</a>,  <a href="/created/hive-153850">Hive Learners</a> and others.</p>

<hr>

<center><h2>Mi Quiz de Programación #32 👨‍💻🛠️🧩</h2></center>

<p>Bienvenido a mi nueva serie de <b>Quizzes de Programación</b>, 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 <a href="/@eniolw">mi blog</a> aquí en Hive y el <a href="/@eniolw/my-coding-quiz-1">primer post</a> donde la presenté.</p>

<h3>Sin más preámbulos, he aquí el acertijo...</h3>

<br>
<center>
<img src="https://images.ecency.com/DQmQpqZQopCsthL3JoMV3eQRWBCo2tZx6wMpNXeXQZfjyhh/quiz_img_es.png" alt="Quiz">
<h6>Por @eniolw</h6>
</center>

<br><center><h3>¿Cuál es tu elección?</h3></center>

<p><b>Solución al <a href="/@eniolw/my-coding-quiz-31">quiz anterior</a>:</b> <b>stem</b>. Primero creamos una cadena <code>base</code> 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 <code>set</code>. Un conjunto es, en pocas palabras, una colección desordenada de elementos únicos.</p>

<p>En nuestro caso, el conjunto <code>a</code> estará formado por todos los caracteres de <code>base</code>, teniendo en cuenta que como el carácter <b>'h'</b> es duplicado en <code>base</code>, no se duplicará en <code>a</code>, ya que los conjuntos no tienen duplicados por definición.</p>

<p>Luego, la línea 4 presenta la operación de diferencia que se aplica a dos conjuntos. Vemos que se aplica a <code>a</code> y <code>b</code>. La forma de leer esa instrucción es qué elementos están en <code>a</code> y no en <code>b</code>. Tenemos que:</p>

<pre><code>a = {'m', 'c', 'e', 'n', 'a', 'h', 't', 's', 'i'}</code></pre>

Y

<pre><code>b = {'c', 'n', 'h', 'a', 'i'}</code></pre>

La diferencia <code>a - b</code> es el conjunto:

<pre><code>c = {'s', 'm', 't', 'e'}</code></pre>

<p>El objeto devuelto por <code>difference</code> es un conjunto nuevo. En la línea final, el conjunto <code>c</code> se convierte en una lista y luego se convierte en una cadena usando <code>join</code>. Lo que está impreso es un anagrama de <b>'stem'</b>, es decir, una palabra con las mismas letras que tiene stem.</p>

<p>El entusiasta @gabrielr29 dio con la respuesta correcta. Felicitaciones.</p>

<hr>

<p>Si quieres bloguear sobre contenido informático y de programación, te invito a unirte a <a href="/">Hive</a> y participar en sus comunidades, tales como <a href="/created/hive-196387">STEM-social</a>, <a href="/created/hive-154226">Develop Spanish</a>, <a href="/created/hive-169321">Programming & Dev</a>, <a href="/created/hive-153850">Hive Learners</a> y otras.</p>

</div>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 528 others
properties (23)
authoreniolw
permlinkmy-coding-quiz-32
categoryhive-140084
json_metadata"{"image":["https://images.ecency.com/DQmeBxSEidpA2NeX4w8etxfTzZt6XWSFdqGhyycZohcVAbv/quiz_img_en.png","https://images.ecency.com/DQmQpqZQopCsthL3JoMV3eQRWBCo2tZx6wMpNXeXQZfjyhh/quiz_img_es.png"],"tags":["hive-140084","coding","programming","python","development","neoxian","proofofbrain","creativecoin","waivio","spanish","tech"],"description":"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 fun way","app":"ecency/3.0.37-vision","format":"markdown+html","image_ratios":["0.6299","0.6299"]}"
created2023-11-10 17:48:45
last_update2023-11-10 17:48:45
depth0
children7
last_payout2023-11-17 17:48:45
cashout_time1969-12-31 23:59:59
total_payout_value4.294 HBD
curator_payout_value4.186 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5,480
author_reputation253,328,400,128,603
root_title"My Coding Quiz #32"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id128,742,814
net_rshares17,710,937,213,376
author_curate_reward""
vote details (592)
@fc-curation ·
!DHEDGE
properties (22)
authorfc-curation
permlinkre-eniolw-20231111t1610335z
categoryhive-140084
json_metadata{"tags":["hive-140084","coding","programming","python","development","neoxian","proofofbrain","creativecoin","waivio","spanish","tech"],"app":"ecency/3.0.37-vision","format":"markdown+html"}
created2023-11-11 11:10:33
last_update2023-11-11 11:10:33
depth1
children1
last_payout2023-11-18 11:10:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length7
author_reputation61,419,996,141,932
root_title"My Coding Quiz #32"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id128,766,360
net_rshares0
@dhedge ·
Out Of Calls
you have 0.0 vote calls available today, your vote calls will reset at next snapshot. You can [buy DHEDGE on Tribaldex](https://tribaldex.com/trade/DHEDGE) or earn some daily by joining one of our many delegation pools at [app.dhedge.cc](https://app.dhedge.cc) to increase your daily amount.
properties (22)
authordhedge
permlinkre-re-eniolw-20231111t1610335z-20231111t111040z
categoryhive-140084
json_metadata"{"app": "beem/0.24.26"}"
created2023-11-11 11:10:39
last_update2023-11-11 11:10:39
depth2
children0
last_payout2023-11-18 11:10:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length291
author_reputation5,003,962,900,629
root_title"My Coding Quiz #32"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id128,766,365
net_rshares0
@mdasein ·
I guess it's the last choice. 🤞 !PGM
properties (22)
authormdasein
permlinkre-eniolw-20231112t20171370z
categoryhive-140084
json_metadata{"tags":["hive-140084","coding","programming","python","development","neoxian","proofofbrain","creativecoin","waivio","spanish","tech"],"app":"ecency/3.0.43-mobile","format":"markdown+html"}
created2023-11-12 12:17:12
last_update2023-11-12 12:17:12
depth1
children3
last_payout2023-11-19 12:17:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length36
author_reputation14,955,469,933,292
root_title"My Coding Quiz #32"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id128,792,110
net_rshares0
@eniolw ·
OK! We'll see about that in the next installment :)
properties (22)
authoreniolw
permlinkre-mdasein-20231114t214829823z
categoryhive-140084
json_metadata{"tags":["hive-140084","coding","programming","python","development","neoxian","proofofbrain","creativecoin","waivio","spanish","tech"],"app":"ecency/3.0.37-vision","format":"markdown+html"}
created2023-11-15 01:48:30
last_update2023-11-15 01:48:30
depth2
children0
last_payout2023-11-22 01:48:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length51
author_reputation253,328,400,128,603
root_title"My Coding Quiz #32"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id128,869,835
net_rshares0
@eniolw ·
Haha, no, that's not it, you're not hopeless.
properties (22)
authoreniolw
permlinkre-mdasein-20231118t12101248z
categoryhive-140084
json_metadata{"tags":["hive-140084","coding","programming","python","development","neoxian","proofofbrain","creativecoin","waivio","spanish","tech"],"app":"ecency/3.0.37-vision","format":"markdown+html"}
created2023-11-18 16:10:03
last_update2023-11-18 16:10:03
depth2
children0
last_payout2023-11-25 16:10:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length45
author_reputation253,328,400,128,603
root_title"My Coding Quiz #32"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id128,971,485
net_rshares0
@pgm-curator ·
<center>Sent 0.1 PGM - 0.1 LVL- 1 STARBITS  - 0.05 DEC - 1 SBT - 0.1 THG - 0.000001 SQM - 0.1 BUDS - 0.01 WOO - 0.005 SCRAP tokens </center>

<center><sub>remaining commands 8</sub></center>


**BUY AND STAKE THE PGM TO SEND A LOT OF TOKENS!**

The tokens that the command sends are: 0.1 PGM-0.1 LVL-0.1 THGAMING-0.05 DEC-15 SBT-1 STARBITS-[0.00000001 BTC (SWAP.BTC) only if you have 2500 PGM in stake or more ]

5000 PGM IN STAKE = 2x rewards! 

![image.png](https://files.peakd.com/file/peakd-hive/zottone444/23t7AyKqAfdxKEJPQrpePMW15BCPhbyrf5VoHWxhBFcEcPLjDUVVQAh9ZAopbmoJDekS6.png)
Discord [![image.png](https://files.peakd.com/file/peakd-hive/hive-135941/23wfr3mtLS9ddSpifBvh7mwLx1rN3eoaSvbwUxTngsNR1GQ8EiZTrC9P9RwZxHCCfK8e5.png)](https://discord.gg/KCvuNTEjWw)


Support the curation account @ pgm-curator with a delegation [10 HP](https://hivesigner.com/sign/op/WyJkZWxlZ2F0ZV92ZXN0aW5nX3NoYXJlcyIseyJkZWxlZ2F0b3IiOiJfX3NpZ25lciIsImRlbGVnYXRlZSI6InBnbS1jdXJhdG9yIiwidmVzdGluZ19zaGFyZXMiOiIxMCJ9XQ..) - [50 HP](https://hivesigner.com/sign/op/WyJkZWxlZ2F0ZV92ZXN0aW5nX3NoYXJlcyIseyJkZWxlZ2F0b3IiOiJfX3NpZ25lciIsImRlbGVnYXRlZSI6InBnbS1jdXJhdG9yIiwidmVzdGluZ19zaGFyZXMiOiI1MCJ9XQ..) - [100 HP](https://hivesigner.com/sign/op/WyJkZWxlZ2F0ZV92ZXN0aW5nX3NoYXJlcyIseyJkZWxlZ2F0b3IiOiJfX3NpZ25lciIsImRlbGVnYXRlZSI6InBnbS1jdXJhb3RyIiwidmVzdGluZ19zaGFyZXMiOiIxMDAifV0.) - [500 HP](https://hivesigner.com/sign/op/WyJkZWxlZ2F0ZV92ZXN0aW5nX3NoYXJlcyIseyJkZWxlZ2F0b3IiOiJfX3NpZ25lciIsImRlbGVnYXRlZSI6InBnbS1jdXJhdG9yIiwidmVzdGluZ19zaGFyZXMiOiI1MDAifV0.) - [1000 HP](https://hivesigner.com/sign/op/WyJ0cmFuc2Zlcl90b192ZXN0aW5nIix7ImZyb20iOiJfX3NpZ25lciIsInRvIjoicGdtLWN1cmF0b3IiLCJhbW91bnQiOiIxMDAwIn1d)

Get **potential** votes from @ pgm-curator by paying in PGM, here is a [guide](https://peakd.com/hive-146620/@zottone444/pay-1-pgm-and-get-4-votes-itaegn)



<sub>I'm a bot, if you want a hand ask @ zottone444</sub>

***
properties (22)
authorpgm-curator
permlinkpgm-curatormdasein1699791449953
categoryhive-140084
json_metadata{"tags":[],"app":"pgm/0.1","format":"markdown+html"}
created2023-11-12 12:17:30
last_update2023-11-12 12:17:30
depth2
children0
last_payout2023-11-19 12:17:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,916
author_reputation3,409,490,822,394
root_title"My Coding Quiz #32"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id128,792,115
net_rshares0
@stemsocial ·
re-eniolw-my-coding-quiz-32-20231111t172116904z
<div class='text-justify'> <div class='pull-left'>
 <img src='https://stem.openhive.network/images/stemsocialsupport7.png'> </div>

Thanks for your contribution to the <a href='/trending/hive-196387'>STEMsocial community</a>. Feel free to join us on <a href='https://discord.gg/9c7pKVD'>discord</a> 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.&nbsp;<br />&nbsp;<br />
</div>
properties (22)
authorstemsocial
permlinkre-eniolw-my-coding-quiz-32-20231111t172116904z
categoryhive-140084
json_metadata{"app":"STEMsocial"}
created2023-11-11 17:21:15
last_update2023-11-11 17:21:15
depth1
children0
last_payout2023-11-18 17:21:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length565
author_reputation22,903,676,462,363
root_title"My Coding Quiz #32"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id128,774,189
net_rshares0