My Coding Quiz #14
hive-196387·@eniolw·
0.000 HBDMy 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>
👍 solominer, deadleaf, evernoticethat, whangster79, recoveryinc, samrisso, tomtothetom, cugel, movement19, wendyburger, hive-195880, smartvote, partitura.stem, acantoni, davidlionfish, lemouth, theshot2414, mathowl, jd4e, mechanicalowl, regularowl, drsensor, taimen, stemng, the.chiomz, temitayo-pelumi, nazom, samest, kingabesh, cyprianj, teemike, electronico, irivers, splash-of-angs63, zuerich, amestyj, oluwatobiloba, shogun82, stem.alfa, holovision.stem, steemstem-trig, steemstem, dna-replication, stemsocial, roelandp, minnowbooster, howo, aboutcoolscience, kenadis, robotics101, melvin7, michaelwrites, tuba777, curie, edb, dhimmel, mobbs, mahdiyari, lottje, postpromoter, r00sj3, intrepidphotos, emiliomoron, dexterdev, deholt, meanroosterfarm, cowpatty, crowdwitness, apokruphos, zeruxanime, hjmarseille, jsalvage, oahb132, nabu.doconosor2, pinkfloyd878, ehizgabriel, privex, samminator, madridbg, nattybongo, pboulet, plicc8, abu78, lamouthe, walterjay, tsoldovieri, wilians, aidefr, sorin.cristescu, enzor, sco, anikekirsten, branbello, geopolis, alexdory, charitybot, francostem, meanbees, marcuz, gerdtrudroepke, javier.dejuan, stem.witness, waraira777, noelyss, chubb149, hyun-soo, inibless, waivio.curator, justtryme90, metabs, techslut, valth, sustainablyyours, helo, alexander.alexis, abigail-dantes, coindevil, sankysanket18, hijosdelhombre, fragmentarion, pab.ink, real2josh, irgendwo, flugschwein, bil.prag, gadrian, de-stem, purelyscience, cubapl, kristall97, afarina46, nazer, andreina57, maar, failingforwards, krrizjos18, davidbright, spryquasar, kqaosphreak, amafable07, nwothini335, vagabond42069, cindynancy, vankushfamily, lugaxker, lenasveganliving, zonguin, lpv, didic, galam, charitymemes, doctor-cog-diss, sc000, sergiomendes, justyy, hhayweaver, sumant, myach, marcolino76, phgnomo, steemvault, croctopus, marcocasario, jtm.support, imbartley, peterpanpan, gohive, sbtofficial, empath, helyorsini, sunsea, zmx, netzisde, revo, cryptononymous, videosteemit, fotogruppemunich, cooltivar, hairgistix, proxy-pal, dcrops, gaottantacinque, gasaeightyfive, cribbio, hive-defender, key-defender.shh, cryptoshotsdoom, cloh76, cnfund, michelle.gent, federacion45, pipiczech, achimmertens, aicoding, driptorchpress, derosnec, steemed-proxy, tomatom, communitybank, steem.services, tggr, punkteam, punchline, greenforever, trouvaille, amberyooper, steemwizards, dipom98, nerdnews, rocky1, vera-vaders-ea, jigstrike, kylo-ren, foxyspirit, bscrypto, gogreenbuddy, hanshotfirst-sm, machan, artsyproxy, alaqrab, yadamaniart, notb4mycoffee, silverwhale, vonaurolacu, epicdice, okluvmee, drhueso, migka, benwickenton, aaronleang, hetty-rowan, fantasycrypto, diabonua, bflanagin, knightsunited, certain, priyandaily, dandesign86, steveconnor, fineartnow, utube, zipporah, sidalim88, mistural, tristancarax, touchman, tazbaz, howiemac, gabrielatravels, movingman, banvie, jemmarti, jmsansan, zirkonov, mugueto2022, meno, sawyn, holoferncro, treefiddybruh, balabambuz, enjar, cryptocoinkb, citizendog, armandosodano, double-negative, borniet, rambutan.art, deveney, tawadak24, minas-glory, bitrocker2020, lorenzopistolesi, darthsauron, rawecz, luisestaba23, rencongland, the-grandmaster, arunava, indigoocean, ilovecryptopl, marivic10, the.success.club, bluemaskman, jijisaurart, kevinwong, jayna, pepskaram, jjerryhan, vinnieleow, josesalazar200, aabcent, h3m4n7, curatorwhale, steemiteducation, anttn, solox, jaydr, crypt0gnome, archangel21, outtheshellvlog, acidtiger, samsemilia7, dawnoner, jessicaossom, albuslucimus, the-burn, minnowpowerup, alvinauh, broncofan99, serylt, cheese4ead, yixn, checkyzk, baboz, schoolforsdg4, zacherybinx, val.halla, steempampanga, strosalia, jansher, chuiiiiiiii, thepeoplesguild, someguy123, torico, miroslavrc, qberry, perpetuum-lynx, javyeslava.photo, elgatoshawua, joshglen, hanggggbeeee, bartosz546, skycae, itharagaian, atomcollector, hiveonboard, belug, thecryptodrive, boynashruddin, dynamicrypto, frissonsteemit, carolinaelly, steemcryptosicko, jackramsey, evagavilan2, clpacksperiment, dashfit, joeyarnoldvn, photohunt, therising, kgakakillerg, letenebreux, cercle, beta500, hive-143869, entraide.rewards, cookaiss, eturnerx-honey, drivingindevon, independance, hivecar, nabab, eliel, rt395, dbddv01, gordon92, scottshots, minerthreat, witkowskipawel, edithbdraw, traderhive, daje10, zerotoone, steem4all, kgswallet, cosplay.hadr, emeraldtiger, minava.museum, sapphireleopard, hive-fr-engine, imcore, tfeldman, sarashew, pompeylad, aichanbot, lichtblick, boxcarblue, princessmewmew, adelepazani, laxam, h-hamilton, anafae, mercurial9, gonklavez9, limn, battebilly, kylealex, the100, altleft, noalys, stickchumpion, thelordsharvest, flyerchen, honeycup-waters, steemegg, carn, anneporter, thelittlebank, filosof103, nyxlabs, ledgar, martibis, brotherhood, vietthuy, educationhive, redrica, onemedia, cakemonster, tokensink, peterale, trezzahn, aries90, ragk88, vickoly, chasmic-cosm, neumannsalva, stayoutoftherz, mamalikh13, apon318, pandasquad, autobodhi, hadrgames, bhdc, doifeellucky, stahlberg, superlotto, cliffagreen, multifacetas, meritocracy, jaylatour, reverio, modernzorker, aboutyourbiz, steemean, baltai, laro-racing, newtrailers, monica-ene, florian-glechner, smitop, baycan, petertag, robmolecule, steemdiamond, atexoras.pub, positiveninja, aicu, trisolaran, chipdip, akumagai, brianoflondon, trippymane, vscampbell, merlin7, dejan.vuckovic, takowi, mind.force, alypanda, madisonelizabeth, podping, iansart, reizak, vittoriozuccala, braaiboy, steemstorage, zirky, dyptre, diabolika, investingpennies, zyx066, bigdizzle91, toocurious, c0wtschpotato, yaelg, hive-127039, metroair, gunthertopp, yoghurt, neneandy, nathyortiz, palasatenea, iamsaray, wynella, detlev, sportscontest, leomarylm, goblinknackers, apendix1994, rmach, mcsvi, firstamendment, zest, jude9, ibt-survival, elevator09, mproxima, sanderjansenart, primersion, mafufuma, vixmemon, robibasa, justlee87, hivecoffee, davideazul, mirteg, revueh, lordvader, hive-144994, grapthar, pladozero, atheistrepublic, dondido, lightpaintershub, jerrybanfield, alt3r, smariam, bushradio, bigtakosensei, randumb, duke77, farleyfund, juecoree, stem-espanol, lorenzor, ydavgonzalez, tomastonyperez, elvigia, acont, reinaseq, fran.frey, aleestra, iamphysical, azulear, sandracarrascal, bartheek, miguelangel2801, josedelacruz, erickyoussif, andrick, uche-nna, giulyfarci52, abachon, sevenoh-fiveoh, psicoluigi, peaceandwar, fatkat, anonymous02, mattbee, marlonfund, capp, walterprofe, ubaldonet, drifter1, buttcoins, cordeta, mariusfebruary, alvin0617, thelogicaldude, lettinggotech, ragnarhewins90, medro-martin, danaedwards, shinedojo, vegan.niinja, scruffy23, hive-126300, acousticguitar, beerlover, sardrt, marcoriccardi, kieranstone, vaultec, nfttunz, gribouille, eric-boucher, afifa, stevenwood, robertbira, nicole-st, esthersanchez, ajfernandez, lk666, flatman, chrisdavidphoto, m1alsan, nwjordan, orlandogonzalez, gifty-e, ennyta, endopediatria, stea90, bluefinstudios, joseluis91, careassaktart, photographercr, gamersclassified, rafaelaquino, sam9999, olubunmiakinmade, beauty197, chapmain,