create account

My Coding Quiz #10 by eniolw

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

<center><h2>My Coding Quiz #10 👨‍💻🛠️🧩</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/DQmf8ZHEL9oH1ZiqQbyk4TTRcnY4ZypAoXmRFEVYUk3uAdv/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-9">previous quiz</a>:</b> <b>['888', '888']</b>. First a variable <code>w</code> of numeric value <b>4</b> is created. This value is then doubled and converted to a character, resulting in the value <b>'8'</b> being assigned to the variable <code>x</code>.</p>

<p>Next, on line 3 we get a string by tripling the contents of <code>x</code>, resulting in the immutable value <b>'888'</b>. This is a Python feature that applies arithmetic operators to strings, so this is not a bug. Along the same line, a <code>y</code> list is created with the newly obtained value.</p>

<p>On line 4 we see another Pythonic trick that applies the <code>*</code> operator to lists. What it does is create a new list with as many copies of <code>y</code> as specified. In this case it's two copies of <code>y</code> (<code>z = y * 2</code>), which translates to <b>['888', '888']</b> which is the value printed on the final line.</p>

<p>Did you know these other uses of the <code>*</code> operator in Python? Believe me, they are not all there is! Congratulations to @splash-of-angs63 for solving this quiz.</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 #10 👨‍💻🛠️🧩</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/DQmVYfU5dFsKgYGeVkXdpQvLjoorDiciZtWdrJU64qhNHU7/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-9">quiz anterior</a>:</b> <b>['888', '888']</b>. Primero se crea una variable <code>w</code> de valor numérico <b>4</b>. Seguidamente, este valor se duplica y se convierte a un caracter, lo que resulta en el valor <b>'8'</b> que se asigna a la variable <code>x</code>.</p>

<p>Acto seguido, en la línea 3 obtenemos una cadena de caracteres triplicando el contenido de <code>x</code>, dando como resultado el valor inmutable <b>'888'</b>. Se trata de un artificio de Python que aplica operadores aritméticos a las cadenas de caracteres, por lo que no se trata de un error. En esa misma línea, se crea una lista <code>y</code> con el valor recien obtenido.</p>

<p>En la línea 4 volvemos a ver otro artificio Pythónico que aplica el operador <code>*</code> a las listas. Lo que hace es crear una nueva lista con tantas copias de <code>y</code> como se haya especificado. En este caso son dos copias de <code>y</code> (<code>z = y * 2</code>), lo que se traduce en <b>['888', '888']</b> que es el valor impreso en la línea final.</p> 

<p>¿Conocías estos otros usos del operador <code>*</code> en Python? ¡Créeme, no son todos los que hay! Felicitaciones a @splash-of-angs63 por resolver este quiz.</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 658 others
properties (23)
authoreniolw
permlinkmy-coding-quiz-10
categoryhive-196387
json_metadata"{"image": ["https://images.ecency.com/DQmf8ZHEL9oH1ZiqQbyk4TTRcnY4ZypAoXmRFEVYUk3uAdv/quiz_img_en.png", "https://images.ecency.com/DQmVYfU5dFsKgYGeVkXdpQvLjoorDiciZtWdrJU64qhNHU7/quiz_img_es.png"], "thumbnails": ["https://images.ecency.com/DQmf8ZHEL9oH1ZiqQbyk4TTRcnY4ZypAoXmRFEVYUk3uAdv/quiz_img_en.png", "https://images.ecency.com/DQmVYfU5dFsKgYGeVkXdpQvLjoorDiciZtWdrJU64qhNHU7/quiz_img_es.png"], "tags": ["hive-196387", "coding", "programming", "python", "quiz", "technology", "creativecoin", "proofofbrain", "neoxian", "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 fun way.", "app": "ecency/3.0.35-vision", "format": "markdown+html"}"
created2023-07-28 09:02:00
last_update2023-07-28 09:02:00
depth0
children5
last_payout2023-08-04 09:02:00
cashout_time1969-12-31 23:59:59
total_payout_value6.392 HBD
curator_payout_value6.262 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,599
author_reputation253,497,814,325,855
root_title"My Coding Quiz #10"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,713,787
net_rshares27,122,777,249,631
author_curate_reward""
vote details (722)
@splash-of-angs63 ·
The second code here converts m to uppercase and creates a list having each of the three characters, i.e., [‘A’, ‘B’, ‘C’]. Now, the print code will code for the first 2 characters of m (ab) and first 4 characters of n. Since in n only three characters are there. So this will deduce to [‘A’, ‘B’, ‘C’]. So, the answer should be   ab [‘A’, ‘B’, ‘C’].
properties (22)
authorsplash-of-angs63
permlinkre-eniolw-2023729t103553576z
categoryhive-196387
json_metadata{"tags":["hive-196387","coding","programming","python","quiz","technology","creativecoin","proofofbrain","neoxian","spanish"],"app":"ecency/3.0.35-vision","format":"markdown+html"}
created2023-07-29 05:05:54
last_update2023-07-29 05:05:54
depth1
children1
last_payout2023-08-05 05:05:54
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_length350
author_reputation49,712,805,563,209
root_title"My Coding Quiz #10"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,737,979
net_rshares0
@eniolw ·
Thanks for your input! We'll see about that next time.
properties (22)
authoreniolw
permlinkre-splash-of-angs63-2023729t16527353z
categoryhive-196387
json_metadata{"tags":["hive-196387","coding","programming","python","quiz","technology","creativecoin","proofofbrain","neoxian","spanish"],"app":"ecency/3.0.35-vision","format":"markdown+html"}
created2023-07-29 20:05:27
last_update2023-07-29 20:05:27
depth2
children0
last_payout2023-08-05 20:05: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_length54
author_reputation253,497,814,325,855
root_title"My Coding Quiz #10"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,754,241
net_rshares0
@stemsocial ·
re-eniolw-my-coding-quiz-10-20230729t043042082z
<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-10-20230729t043042082z
categoryhive-196387
json_metadata{"app":"STEMsocial"}
created2023-07-29 04:30:42
last_update2023-07-29 04:30:42
depth1
children0
last_payout2023-08-05 04:30:42
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,711,652,468
root_title"My Coding Quiz #10"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,737,492
net_rshares0
@taradraz1 ·
The answer for me its abc['A' ,'B','C',None], arrays start from 0 not 1 so, saying m[:2] means first 3 letters in lowercase abc and then n[:4] means 4 spaces in array, first 3 are A, B and C and theres no more so None at the end, i guess, im kind of confused now but i will go with that answer.
properties (22)
authortaradraz1
permlinkre-eniolw-2023729t11959358z
categoryhive-196387
json_metadata{"tags":["hive-196387","coding","programming","python","quiz","technology","creativecoin","proofofbrain","neoxian","spanish"],"app":"ecency/3.0.35-vision","format":"markdown+html"}
created2023-07-29 06:20:00
last_update2023-07-29 06:20:00
depth1
children1
last_payout2023-08-05 06:20:00
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_length294
author_reputation14,594,686,102,827
root_title"My Coding Quiz #10"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,738,833
net_rshares0
@eniolw ·
Noted! I will reveal the solution in the next installment. Keep and eye on it if you want.
👍  
properties (23)
authoreniolw
permlinkre-taradraz1-2023729t16729227z
categoryhive-196387
json_metadata{"tags":["hive-196387","coding","programming","python","quiz","technology","creativecoin","proofofbrain","neoxian","spanish"],"app":"ecency/3.0.35-vision","format":"markdown+html"}
created2023-07-29 20:07:30
last_update2023-07-29 20:07:30
depth2
children0
last_payout2023-08-05 20:07: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_length90
author_reputation253,497,814,325,855
root_title"My Coding Quiz #10"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id125,754,305
net_rshares675,909,467
author_curate_reward""
vote details (1)