create account

My Coding Quiz #14 by eniolw

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

<center><h2>My Coding Quiz #14 👨‍💻🛠️🧩</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/DQmW7Kqt58FHwCSnD8Afe9uFFXJbHcRyTYkAxbmcVqp1MeG/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-13">previous quiz</a>:</b> <b>SS</b>. Line 1 defines a string <code>a</code> with the content <code>" Science "</code>. Note the deliberate presence of whitespace at the beginning and end of the string.</p>

<p>Line 2 creates a <code>b</code> variable. To do this, first whitespace at the beginning and end of <code>a</code> is removed using the built-in <code>strip</code> method. A special slice is then applied using the <code>[::-1]</code> notation. This is another of many ways to create a reversed list in Python. The <code>-1</code> at the end indicates that the step should be done one at a time, but in reverse. In the end, the value of <code>b</code> will be <code>'ecneicS'</code>.</p>

<p>Line 3 creates a variable <code>c</code> with <code>a</code> and <code>b</code> elements accessed by indexes. We know that the element at index 1 of <code>a</code> has the value <b>'S'</b>, and it is not surprising that the element at index -1 of <code>b</code> corresponds to the last one, whose value is also <b>'S'</b>. The value of <code>c</code>, therefore, will be <b>'SS'</b>, which is printed at line 4.</p>

<p>Both @rafaelaquino and @jesalmofficial solved this quiz and @jesalmofficial even provided an explanation. Very good!</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 #14 👨‍💻🛠️🧩</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/DQmNU4Di9YRa8NZ3ZM3yxQUJMERMGMFHQaSzLovJVep26Xk/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-13">quiz anterior</a>:</b> <b>SS</b>. La línea 1 define una cadena de caracteres <code>a</code> con el contenido <code>" Science "</code>. Nótese la presencia deliberada de espacios en blanco al principio y final de la cadena.</p>

<p>La línea 2 crea una variable <code>b</code>. Para ello, primero se remueven los espacios en blanco al principio y al final de <code>a</code> usando el método incorporado <code>strip</code>. Luego se aplica un rebanado especial usando la notación <code>[::-1]</code>. Esta es otra de muchas maneras de crear una lista invertida en Python. El <code>-1</code> al final indica que el paso debe hacerse de uno en uno, pero en sentido contrario. Al final, el valor de <code>b</code> será <code>'ecneicS'</code>.</p>

<p>La línea 3 crea una variable <code>c</code> con elementos de <code>a</code> y <code>b</code> accedidos mediante índices. Sabemos que el elemento en el índice 1 de <code>a</code> posee el valor <b>'S'</b>, y no es una sorpresa que el elemento en el índice -1 de <code>b</code> corresponda al último, cuyo valor también es <b>'S'</b>. El valor de <code>c</code>, por tanto, será <b>'SS'</b>, lo impreso en la línea 4. </p>

<p>Tanto @rafaelaquino como @jesalmofficial resolvieron este quiz y @jesalmofficial incluso proveyó una explicación. ¡Muy bien!</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 547 others
properties (23)
authoreniolw
permlinkmy-coding-quiz-14
categoryhive-196387
json_metadata"{"image": ["https://images.ecency.com/DQmW7Kqt58FHwCSnD8Afe9uFFXJbHcRyTYkAxbmcVqp1MeG/quiz_img_en.png", "https://images.ecency.com/DQmNU4Di9YRa8NZ3ZM3yxQUJMERMGMFHQaSzLovJVep26Xk/quiz_img_es.png"], "thumbnails": ["https://images.ecency.com/DQmW7Kqt58FHwCSnD8Afe9uFFXJbHcRyTYkAxbmcVqp1MeG/quiz_img_en.png", "https://images.ecency.com/DQmNU4Di9YRa8NZ3ZM3yxQUJMERMGMFHQaSzLovJVep26Xk/quiz_img_es.png"], "tags": ["hive-196387", "programming", "coding", "science", "technology", "python", "quiz", "neoxian", "proofofbrain", "spanish"], "description": "My Coding Quiz #14. 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-08-17 08:01:09
last_update2023-08-17 08:01:09
depth0
children7
last_payout2023-08-24 08:01:09
cashout_time1969-12-31 23:59:59
total_payout_value4.310 HBD
curator_payout_value4.223 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,849
author_reputation256,442,507,312,340
root_title"My Coding Quiz #14"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id126,338,458
net_rshares22,520,474,773,692
author_curate_reward""
vote details (611)
@hibadurahmon ·
With my little knowledge of python codes, 0.1111 is my choice.
👍  ,
properties (23)
authorhibadurahmon
permlinkre-eniolw-rzjm2w
categoryhive-196387
json_metadata{"tags":["hive-196387"],"app":"peakd/2023.7.1"}
created2023-08-17 16:06:42
last_update2023-08-17 16:06:42
depth1
children2
last_payout2023-08-24 16:06: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_length62
author_reputation1,154,707,292,731
root_title"My Coding Quiz #14"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id126,348,468
net_rshares0
author_curate_reward""
vote details (2)
@eniolw ·
Ok! We'll see about that in the next installment. Thanks for participating.
properties (22)
authoreniolw
permlinkre-hibadurahmon-2023818t11341192z
categoryhive-196387
json_metadata{"tags":["hive-196387"],"app":"ecency/3.0.36-vision","format":"markdown+html"}
created2023-08-18 05:13:42
last_update2023-08-18 05:13:42
depth2
children1
last_payout2023-08-25 05:13: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_length75
author_reputation256,442,507,312,340
root_title"My Coding Quiz #14"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id126,364,349
net_rshares0
@hibadurahmon ·
It's a pleasure
👍  ,
properties (23)
authorhibadurahmon
permlinkre-eniolw-rzkvzk
categoryhive-196387
json_metadata{"tags":["hive-196387"],"app":"peakd/2023.7.1"}
created2023-08-18 08:38:27
last_update2023-08-18 08:38:27
depth3
children0
last_payout2023-08-25 08:38: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_length15
author_reputation1,154,707,292,731
root_title"My Coding Quiz #14"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id126,367,605
net_rshares65,541,849
author_curate_reward""
vote details (2)
@rafaelaquino ·
Mi respuesta en este ejercicio es:

1
👍  ,
properties (23)
authorrafaelaquino
permlinkre-eniolw-rzl7j0
categoryhive-196387
json_metadata{"tags":["hive-196387"],"app":"peakd/2023.7.1"}
created2023-08-18 12:47:24
last_update2023-08-18 12:47:24
depth1
children0
last_payout2023-08-25 12:47: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_length37
author_reputation112,331,752,359,894
root_title"My Coding Quiz #14"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id126,372,118
net_rshares107,830,714
author_curate_reward""
vote details (2)
@splash-of-angs63 ·
a = 3 (0b0011) and b =2 (0b0010). on performing bitwise XOR operator, the resultant binary representation will be 0b0001, which is 1 in decimal. So, it should be 1.
👍  ,
properties (23)
authorsplash-of-angs63
permlinkre-eniolw-2023817t225947592z
categoryhive-196387
json_metadata{"tags":["hive-196387","programming","coding","science","technology","python","quiz","neoxian","proofofbrain","spanish"],"app":"ecency/3.0.36-vision","format":"markdown+html"}
created2023-08-17 17:29:45
last_update2023-08-17 17:29:45
depth1
children1
last_payout2023-08-24 17:29: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_length164
author_reputation49,712,805,563,209
root_title"My Coding Quiz #14"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id126,350,238
net_rshares0
author_curate_reward""
vote details (2)
@eniolw ·
Ok! Thanks for your input.
properties (22)
authoreniolw
permlinkre-splash-of-angs63-2023818t11416388z
categoryhive-196387
json_metadata{"tags":["hive-196387","programming","coding","science","technology","python","quiz","neoxian","proofofbrain","spanish"],"app":"ecency/3.0.36-vision","format":"markdown+html"}
created2023-08-18 05:14:15
last_update2023-08-18 05:14:15
depth2
children0
last_payout2023-08-25 05:14: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_length26
author_reputation256,442,507,312,340
root_title"My Coding Quiz #14"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id126,364,358
net_rshares0
@stemsocial ·
re-eniolw-my-coding-quiz-14-20230818t054120475z
<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-14-20230818t054120475z
categoryhive-196387
json_metadata{"app":"STEMsocial"}
created2023-08-18 05:41:21
last_update2023-08-18 05:41:21
depth1
children0
last_payout2023-08-25 05:41: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_length565
author_reputation22,927,767,309,334
root_title"My Coding Quiz #14"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id126,364,905
net_rshares0