create account

My Coding Quiz #7 by eniolw

View this thread on: hive.blogpeakd.comecency.com
· @eniolw · (edited)
$10.97
My Coding Quiz #7
<div class="text-justify">

<center><h2>My Coding Quiz #7 👨‍💻🛠️🧩</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/DQmNjsJTrNgAkVEPAokHYkon3DmUMVUeSQFfiXsEMtUAivq/quiz_img_en.png" alt="Quiz"><h3>By @eniolw</h3></center>
    
<br><center><h3>What's your choice?</h3></center>
    
<p><b>Solution to the <a href="/@eniolw/my-coding-quiz-6">previous quiz</a>:</b> <b>4 []</b>. Line 1 defines a variable <code>p</code> containing a <b>range object</b>, which is an immutable sequence of integers. It is specified to start at 0 (inclusive) and end at 5 (exclusive), i.e., it spans <b>0, 1, 2, 3</b> and <b>4</b>.</p> 

<p>This range object is iterated through a <code>for</code> in line 4, which could have been reduced to a single line as <code>for i in range(0, 5)</code>. The for loop iterates through the sequence without doing anything else and the last value of <code>i</code> will be <b>4</b>. It cannot be 5 because the for loop derives its indices from the already pre-established <code>p</code> sequence.</p>
        
<p>Line 2 defines a range object from <b>0 to -3</b>, different from the previous one. By default, the range object iterates at a step of positive 1 and is made in such a way that it could not create an infinite loop. When this sequence is converted to a list at line 3, the list will be empty.</p>
        
<p>Hence the output instructed in line 6 is <b>4 []</b>. That wasn't so hard, was it? @rafaelaquino managed to solve this riddle. Nice!</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 #7 👨‍💻🛠️🧩</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/DQmdSrAB5goJVQfCcG3H8yRWmaD2bdSQL54hRQ8DMEQGS7G/quiz_img_es.png" alt="Quiz"><h3>Por @eniolw</h3></center>
    
<br><center><h3>¿Cuál es tu elección?</h3></center>
    
<p><b>Solución al <a href="/@eniolw/my-coding-quiz-6">quiz anterior</a>:</b> <b>4 []</b>. La línea 1 define una variable <code>p</code> que contiene un <b>objeto de rango</b>, que es una secuencia inmutable de enteros. Se especifica que comienza en 0 (inclusivo) y termina en 5 (exclusivo), es decir, abarca <b>0, 1, 2, 3</b> y <b>4</b>.</p>

<p>Este objeto de rango se itera a través de un <code>for</code> en la línea 4, que podría haberse reducido a una sola línea como <code>for i in range(0, 5)</code>. El for itera a través de la secuencia sin hacer nada más y el último valor de <code>i</code> será <b>4</b>. No puede ser 5 porque el bucle for deriva sus índices de la secuencia <code>p</code> ya preestablecida.</p>
        
<p>La línea 2 define un objeto de rango de <b>0 a -3</b>, diferente al anterior. Por defecto, el objeto de rango itera en un paso de 1 positivo y está hecho de tal manera que no puede crear un bucle infinito. Cuando esta secuencia se convierta en una lista en la línea 3, la lista estará vacía.</p>
        
<p>Por lo tanto, la salida indicada en la línea 6 es <b>4 []</b>. No fue tan difícil, ¿verdad? @rafaelaquino logró resolver este acertijo. ¡Genial!</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 546 others
properties (23)
authoreniolw
permlinkmy-coding-quiz-7
categoryhive-153850
json_metadata"{"image":["https://images.ecency.com/DQmNjsJTrNgAkVEPAokHYkon3DmUMVUeSQFfiXsEMtUAivq/quiz_img_en.png","https://images.ecency.com/DQmdSrAB5goJVQfCcG3H8yRWmaD2bdSQL54hRQ8DMEQGS7G/quiz_img_es.png"],"thumbnails":["https://images.ecency.com/DQmNXtxS3Umrj9M1SJJU81hg2UNre4Uke8cbEuGaLajVyhT/quiz_img_en.png","https://images.ecency.com/DQmPC9n8GePmQ1huXwwgepv8CqMm3pqDivy8KmXbdFsbifF/quiz_img_es.png"],"tags":["hive-153850","python","coding","programming","stemsocial","neoxian","proofofbrain","waivio","creativecoin","spanish"],"description":"My Coding Quiz #7 👨‍💻🛠️🧩 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 in a simple and fun way.","app":"ecency/3.0.34-vision","format":"markdown+html","image_ratios":["0.9828","0.9828"]}"
created2023-07-12 09:28:42
last_update2023-07-12 15:34:30
depth0
children5
last_payout2023-07-19 09:28:42
cashout_time1969-12-31 23:59:59
total_payout_value5.539 HBD
curator_payout_value5.430 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,638
author_reputation256,499,626,606,412
root_title"My Coding Quiz #7"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,256,281
net_rshares22,815,095,517,744
author_curate_reward""
vote details (610)
@rafaelaquino ·
La respuesta correcta del acertijo anterior me saltó a la vista! Ahora Corresponde resolver este nuevo reto. 
properties (22)
authorrafaelaquino
permlinkre-eniolw-rxot5m
categoryhive-153850
json_metadata{"tags":["hive-153850"],"app":"peakd/2023.7.1"}
created2023-07-12 14:20:12
last_update2023-07-12 14:20:12
depth1
children0
last_payout2023-07-19 14:20: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_length109
author_reputation112,481,617,279,717
root_title"My Coding Quiz #7"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,261,415
net_rshares0
@rafaelaquino ·
Es esta oportunidad mi respuesta no está en la lista de posibles soluciones. 
Mi solución es:
[1,3]
properties (22)
authorrafaelaquino
permlinkre-eniolw-rxothq
categoryhive-153850
json_metadata{"tags":["hive-153850"],"app":"peakd/2023.7.1"}
created2023-07-12 14:27:27
last_update2023-07-12 14:27:27
depth1
children2
last_payout2023-07-19 14:27: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_length99
author_reputation112,481,617,279,717
root_title"My Coding Quiz #7"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,261,553
net_rshares0
@eniolw ·
Revisa de nuevo :)
Check again :)
👍  
properties (23)
authoreniolw
permlinkre-rafaelaquino-2023712t113528930z
categoryhive-153850
json_metadata{"tags":["hive-153850"],"app":"ecency/3.0.34-vision","format":"markdown+html"}
created2023-07-12 15:35:30
last_update2023-07-12 15:35:30
depth2
children1
last_payout2023-07-19 15:35: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_length33
author_reputation256,499,626,606,412
root_title"My Coding Quiz #7"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,262,912
net_rshares19,311,943,237
author_curate_reward""
vote details (1)
@rafaelaquino ·
Saludos.
Cuando era: x = [0,1,2,3,4], mi respuesta era [1,3]. Es probable que mi vista falló. :)

Ahora x = [4,3,2,1,0,-1]
mi respuesta es:
[3, 1]
properties (22)
authorrafaelaquino
permlinkre-eniolw-rxoxgv
categoryhive-153850
json_metadata{"tags":["hive-153850"],"app":"peakd/2023.7.1"}
created2023-07-12 15:53:21
last_update2023-07-12 15:53:21
depth3
children0
last_payout2023-07-19 15:53:21
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_length147
author_reputation112,481,617,279,717
root_title"My Coding Quiz #7"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,263,223
net_rshares0
@stemsocial ·
re-eniolw-my-coding-quiz-7-20230713t080023931z
<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-7-20230713t080023931z
categoryhive-153850
json_metadata{"app":"STEMsocial"}
created2023-07-13 08:00:24
last_update2023-07-13 08:00:24
depth1
children0
last_payout2023-07-20 08:00:24
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,927,767,309,334
root_title"My Coding Quiz #7"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,282,867
net_rshares0