create account

My Coding Quiz #8 by eniolw

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

<center><h2>My Coding Quiz #8 👨‍💻🛠️🧩</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/DQmR3ko3d8GRxAjaCYEsmkUtwgQ2GYv48qE1ajmXnzrNtmg/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-7">previous quiz</a>:</b> <b>[3, 1]</b>. Line 1 specifies a list containing numeric elements and is called <code>x</code>. The same thing happens on the next line, except that the list is empty and is identified as <code>y</code>.</p>

<p>The heart of the matter is given in lines 3 and 4, where these two lists are iterated over and expanded with new elements. Specifically, the numeric sequence given to the <code>for</code> loop is defined as <code>range(1, 5, 2)</code>. This means that it will consist of numbers between 1 and 5, but incrementing at the rate of 2, which is the third argument of the range.</p>
    
<p>In this way, the sequence starts at <b>1</b>, increments to <b>3</b> and then stops, since it cannot increment to 5 because 5 is the specified stop and we know that this stop value is non-inclusive. The numbers returned by this range, therefore, will be <b>1</b> and <b>3</b>, which are the values that the <code>i</code> variable of the <code>for</code> loop will take.</p>
    
<p>So, it's not hard to see that the <code>y</code> list will be expanded with the values of the <code>x</code> list at indices 1 and 3, and these values are <b> 3</b> and <b>1</b> respectively. Hence <b>[3, 1]</b> is the output produced on the final line.</p>
    
<p>I'd say the gist of the puzzle is knowing the role of incrementing the range by 2, which is not difficult if you're familiar with Python. Once again, @rafaelaquino has solved this exercise. What a great ability to read and execute code in your head!</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 #8 👨‍💻🛠️🧩</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/DQmSPxMgVfkofwByaJc4Kvqpxbtan5ghcN5BXCPVpVU2Kcw/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-7">quiz anterior</a>:</b> <b>[3, 1]</b>. La línea 1 especifica una lista que contiene elementos numéricos y se llama <code>x</code>. Lo mismo pasa en la línea siguiente, excepto que la lista está vacía y se indentifica como <code>y</code>.</p>

<p>El meollo del asunto se da en las líneas 3 y 4, donde estas dos listas son iteradas y expandidas con nuevos elementos. Específicamente, la secuencia numérica dada al <code>for</code> está definida como <code>range(1, 5, 2)</code>. Esto significa que comprenderá los números entre 1 y 5, pero incrementando a ritmo de 2, que es el tercer argumento del range.</p>
    
<p>De esta manera, la secuencia comienza en <b>1</b>, incrementa a <b>3</b> y luego se detiene, pues no puede incrementar a 5 por cuanto 5 es el tope especificado y sabemos que este tope es no inclusivo. Los números retornados por este range, por tanto, serán <b>1</b> y <b>3</b>, que son los valores que tomará la variable <code>i</code> del <code>for</code>.</p>
    
<p>Así, no es difícil ver que la lista <code>y</code> será expandida con los valores de la lista <code>x</code> en los índices 1 y 3, y estos valores son <b>3</b> y <b>1</b> respectivamente. De allí que <b>[3, 1]</b> sea la salida producida en la línea final.</p>
    
<p>Diría que la esencia del acertijo está en conocer el papel de incremento en 2 del range, algo nada difícil si estás familiarizado con Python. Una vez más, @rafaelaquino ha resuelto este ejercicio. ¡Qué buena habilidad para leer y ejecutar código mentalmente!</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 427 others
properties (23)
authoreniolw
permlinkmy-coding-quiz-8
categoryhive-196387
json_metadata"{"image": ["https://images.ecency.com/DQmR3ko3d8GRxAjaCYEsmkUtwgQ2GYv48qE1ajmXnzrNtmg/quiz_img_en.png", "https://images.ecency.com/DQmSPxMgVfkofwByaJc4Kvqpxbtan5ghcN5BXCPVpVU2Kcw/quiz_img_es.png"], "thumbnails": ["https://images.ecency.com/DQmR3ko3d8GRxAjaCYEsmkUtwgQ2GYv48qE1ajmXnzrNtmg/quiz_img_en.png", "https://images.ecency.com/DQmSPxMgVfkofwByaJc4Kvqpxbtan5ghcN5BXCPVpVU2Kcw/quiz_img_es.png"], "tags": ["hive-196387", "programming", "coding", "python", "quiz", "technology", "neoxian", "creativecoin", "proofofbrain", "spanish"], "description": "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.", "app": "ecency/3.0.35-vision", "format": "markdown+html"}"
created2023-07-18 11:01:48
last_update2023-07-18 11:01:48
depth0
children7
last_payout2023-07-25 11:01:48
cashout_time1969-12-31 23:59:59
total_payout_value4.246 HBD
curator_payout_value4.161 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5,349
author_reputation255,152,178,720,009
root_title"My Coding Quiz #8"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,422,268
net_rshares17,562,439,242,670
author_curate_reward""
vote details (491)
@rafaelaquino ·
Contento y muy emocionado por mi participación en el reto anterior. Le felicito porque ésta es una manera muy efectiva para promocionar uno de los lenguajes de programación más populares y de mayor demanda en la actualidad. Seguiré pendiente de tus retos!
👍  ,
properties (23)
authorrafaelaquino
permlinkre-eniolw-rxzxqs
categoryhive-196387
json_metadata{"tags":["hive-196387"],"app":"peakd/2023.7.1"}
created2023-07-18 14:33:06
last_update2023-07-18 14:33:06
depth1
children1
last_payout2023-07-25 14:33:06
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_length255
author_reputation110,378,642,632,523
root_title"My Coding Quiz #8"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,426,559
net_rshares161,459,421
author_curate_reward""
vote details (2)
@eniolw ·
Seguro. Gracias por participar!
properties (22)
authoreniolw
permlinkre-rafaelaquino-2023719t13029765z
categoryhive-196387
json_metadata{"tags":["hive-196387"],"app":"ecency/3.0.35-vision","format":"markdown+html"}
created2023-07-19 17:00:30
last_update2023-07-19 17:00:30
depth2
children0
last_payout2023-07-26 17:00: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_length31
author_reputation255,152,178,720,009
root_title"My Coding Quiz #8"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,458,862
net_rshares0
@rejoice142 ·
This is quite interesting,I love python for it's cast application, you just reminded me of a friend who is into data analysis, he does more of this each time I visit him. Thanks for sharing 
👍  ,
properties (23)
authorrejoice142
permlinkre-eniolw-ry015w
categoryhive-196387
json_metadata{"tags":["hive-196387"],"app":"peakd/2023.7.1"}
created2023-07-18 15:46:45
last_update2023-07-18 15:46:45
depth1
children1
last_payout2023-07-25 15:46:45
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_length190
author_reputation808,580,137,920
root_title"My Coding Quiz #8"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,428,133
net_rshares161,208,928
author_curate_reward""
vote details (2)
@eniolw ·
Yeah, Python is quite popular for that. Thanks for stopping by.
properties (22)
authoreniolw
permlinkre-rejoice142-2023719t1311693z
categoryhive-196387
json_metadata{"tags":["hive-196387"],"app":"ecency/3.0.35-vision","format":"markdown+html"}
created2023-07-19 17:01:03
last_update2023-07-19 17:01:03
depth2
children0
last_payout2023-07-26 17:01: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_length63
author_reputation255,152,178,720,009
root_title"My Coding Quiz #8"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,458,877
net_rshares0
@splash-of-angs63 ·
8+5+(4*3) = 25

properties (22)
authorsplash-of-angs63
permlinkre-eniolw-2023719t17283322z
categoryhive-196387
json_metadata{"tags":["hive-196387","programming","coding","python","quiz","technology","neoxian","creativecoin","proofofbrain","spanish"],"app":"ecency/3.0.35-vision","format":"markdown+html"}
created2023-07-19 11:58:06
last_update2023-07-19 11:58:06
depth1
children1
last_payout2023-07-26 11:58:06
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_length16
author_reputation49,712,805,563,209
root_title"My Coding Quiz #8"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,451,859
net_rshares0
@eniolw ·
Hey! Ok, we'll see.
properties (22)
authoreniolw
permlinkre-splash-of-angs63-2023719t13126935z
categoryhive-196387
json_metadata{"tags":["hive-196387","programming","coding","python","quiz","technology","neoxian","creativecoin","proofofbrain","spanish"],"app":"ecency/3.0.35-vision","format":"markdown+html"}
created2023-07-19 17:01:27
last_update2023-07-19 17:01:27
depth2
children0
last_payout2023-07-26 17:01:27
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_length19
author_reputation255,152,178,720,009
root_title"My Coding Quiz #8"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,458,894
net_rshares0
@stemsocial ·
re-eniolw-my-coding-quiz-8-20230719t104544458z
<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-8-20230719t104544458z
categoryhive-196387
json_metadata{"app":"STEMsocial"}
created2023-07-19 10:45:45
last_update2023-07-19 10:45:45
depth1
children0
last_payout2023-07-26 10:45:45
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,918,176,844,004
root_title"My Coding Quiz #8"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,450,545
net_rshares0