My Coding Quiz #29
hive-196387·@eniolw·
0.000 HBDMy Coding Quiz #29
<div class="text-justify"> <center><h2>My Coding Quiz #29 👨💻🛠️🧩</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/DQmXRhezdKYRRkU3GWbF1bFYSDeXbks5cTt2Cvf66WTZMRk/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-28">previous quiz</a>:</b> Line 1 simply creates a <code>d</code> list of two numeric elements, while line 2 creates an inline <code>func</code> function that takes a parameter and applies the <code>pop</code> method to it., returning the removed value.</p> <p>Line 3 introduces the function <code>all</code>, which evaluates a list that, as we will see, is modified at run time. We see that <code>func</code> is called a couple of times, providing the list <code>d</code> as an argument and this is modified, since <i>it is a pass by reference</i>. By the time the value of the third list element on line 3 is evaluated, <code>d</code> will be empty, so it will be considered <b>Falsy</b>. The results that <code>all</code> will evaluate will then be <b>-1</b>, <b>2</b> and <b>[]</b>.</p> <p>The <code>all</code> function returns True if and only if all the elements in the given list are Truthy, but in our case that is impossible. Hence the value of <code>r</code> is <b>False</b> and is what is printed on the screen at the end.</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> and others.</p> <hr> <center><h2>Mi Quiz de Programación #29 👨💻🛠️🧩</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/DQmNeVfWhGJKrJmmeFogMtva93GgtAVyRpiy4sDmyKm8CAr/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-28">quiz anterior</a>:</b> <b>False</b>. La línea 1 simplemente crea una lista <code>d</code> de dos elementos numéricos, mientras que la línea 2 crea una función inline <code>func</code> que toma un parámetro y le aplica el método <code>pop</code>, devolviendo el valor retirado.</p> <p>La línea 3 introduce la función <code>all</code>, la cual evalúa una lista que, como veremos, es modificada en tiempo de ejecución. Vemos que se llama a <code>func</code> un par de veces, proveyendo la lista <code>d</code> como argumento y esta es modificada, pues <i>es un paso por referencia</i>. Para cuando se evalúe el valor del tercer elemento de la lista de la linea 3, <code>d</code> estará vacía, por lo que se considerará como <b>Falsy</b> (falso). Los resultados que evaluará <code>all</code> serán entonces <b>-1</b>, <b>2</b> y <b>[]</b>.</p> <p>La función <code>all</code> retorna True si y solo si todos los elementos de la lista dada son Truthy (verdaderos), pero en nuestro caso eso es imposible. De allí que el valor de <code>r</code> es <b>False</b> y es lo impreso en pantalla al final.</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> y otras.</p> </div>
👍 deadleaf, lemouth, davidlionfish, steemitbloggers, mathowl, jd4e, mechanicalowl, regularowl, drsensor, splash-of-angs63, hispapro, eonwarped, manuelmusic, eleazarvo, racarjoal, quintaesencia, saravm82, graciadegenios, georgelys, lqch, adolfom, enyusael, evagavilan2, hexagono6, victordumont, cirangela, aguamiel, annafenix, asderhz, mairimgo23, gislandpoetic, franvenezuela, amaillo-m, universodaniel, eollarvesm, warofcriptonft, smile27, mariiestefania, frankches, enfocate, risckylu, elisonr13, ubikalo, dracrow, arzkyu97, andreasalas, maryelin, daniel2001, eliezerfloyd, jesuspsoto, apeboy, rawecz, hispaplus, yggdrasilwind, norokochan, yeidelyt, brujita18, yenmendt, beysyd, ferbu, amaillo, andre-marg25, gercripto, susurrodmisterio, esalcedo, abejaobrera, ricardoeloy, chechostreet, hiversbqto, hispaliterario, flywithmarlin, ojsuarez2, niggyayo, cuatrolarense, yanguaro, jordangerder, nathyortiz, petrarodriguez, yonnathang, javikun, jennyzer, edfer18, alvarezjessica, magdiel7, caribayarte, soychalbed, krrizjos18, zackygamer, marleyn, luisestaba23, leticiapereira, juanmanuellopez1, belkisa758, janettyanez, esthersanchez, miguelstar, foxlatam, yiobri, jerusa777, zuerich, vinamra, electronico, amestyj, futurekr, tipu, afzalqamar, kingscrown, safar01, tobias-g, memepress, mightypanda, naty16, alex-hm, dappstats, julesquirin, hydrodino, blockbroccoli, tub3r0, ehizgabriel, boatymcboatface, theshell, cryptogambit, koshwe, longer, el-dee-are-es, jancharlest, steemstem-trig, steemstem, dna-replication, minnowbooster, howo, aboutcoolscience, robotics101, stemsocial, curie, techslut, edb, oluwatobiloba, jga, sustainablyyours, helo, aidefr, sankysanket18, sco, anikekirsten, branbello, emiliomoron, dexterdev, flugschwein, de-stem, purelyscience, pboulet, meanroosterfarm, cowpatty, stem.witness, afarina46, hjmarseille, andreina57, maar, oahb132, maxelitereturned, tuba777, justtryme90, lamouthe, metabs, valth, samminator, mahdiyari, alexander.alexis, htotoo, noloafing, enzor, lottje, postpromoter, madridbg, fragmentarion, deholt, javier.dejuan, crowdwitness, zeruxanime, jsalvage, kqaosphreak, prosocialise, plicc8, nazom, vankushfamily, timix648, michelle.gent, dhimmel, lugaxker, tsoldovieri, abigail-dantes, zonguin, wilians, kenadis, lpv, intrepidphotos, pab.ink, real2josh, kingabesh, geopolis, alexdory, charitybot, melvin7, francostem, croctopus, rambutan.art, michaelwrites, temitayo-pelumi, doctor-cog-diss, marcuz, gerdtrudroepke, noelyss, pinkfloyd878, blackdaisyft, vagabond42069, inibless, cindynancy, galam, vonaurolacu, endrius, waivio.curator, walterjay, mobbs, bitrocker2020, hijosdelhombre, crystalhuman, cubapl, jtm.support, greenforever, mayorkeys, amafable07, dashfit, rt395, revo, straykat, charitymemes, steem.services, machan, krisconkr, altleft, omarrojas, failingforwards, kevinwong, zipporah, josesalazar200, cryptofiloz, meritocracy, dcrops, brianoflondon, chris-uk, noalys, elgatoshawua, clpacksperiment, fineartnow, armandosodano, sidalim88, yozen, val.halla, steveconnor, takowi, steempampanga, podping, princessmewmew, rocky1, kgakakillerg, dailyspam, jishan5, yunnie, justfavour, alaqrab, aicoding, russellstockley, dev.maverick, thelordsharvest, utube, lorenzopistolesi, certain, goodcontentbot, kgswallet, zirky, vscampbell, migka, yadamaniart, minerthreat, drawmeaship, peterpanpan, yixn, filmmaking4hive, voter003, coindevil, travelingmercies, sunsea, mejustandrew, dragibusss, positiveninja, thelittlebank, javyeslava.photo, steemean, lukasbachofner, voter001, skycae, hetty-rowan, fwxiii, davidbright, thepeoplesguild, reverio, diabolika, dipom98, smitop, leomarylm, steemcryptosicko, jessicaossom, drhueso, toocurious, fotogruppemunich, cnfund, sumant, cryptononymous, carn, steemvault, outtheshellvlog, trisolaran, voter002, palasatenea, hiveonboard, aries90, balabambuz, dynamicrypto, irgendwo, edithbdraw, baltai, sarashew, boynashruddin, indigoocean, louis00334, m0rt0nmattd, crypt0gnome, sorin.cristescu, federacion45, doifeellucky, tomatom, witkowskipawel, aabcent, cloh76, hhayweaver, miroslavrc, cryptocoinkb, peterale, sbtofficial, cosmosbrasil, joshglen, kylealex, cliffagreen, bil.prag, kristall97, knightsunited, sgt-dan, serylt, thecryptodrive, jigstrike, mind.force, atexoras.pub, braaiboy, we-are-lucky, cheese4ead, perpetuum-lynx, gohive, minas-glory, enjar, dreamm, hive-127039, thales7, wynella, yourmind, steemdiamond, okluvmee, poolpartylegolas, daje10, sc000, technico, vittoriozuccala, unitqm, h3m4n7, dbddv01, educationhive, opticus, rhemagames, driptorchpress, iansart, eliel, pepskaram, zmx, yaelg, atomcollector, c0wtschpotato, robmolecule, bflanagin, rencongland, cugel, meno, empath, lenasveganliving, bennettitalia, proxy-pal, trouvaille, benwickenton, chipdip, fsm-core, the100, borniet, tawadak24, modernzorker, steemiteducation, steemed-proxy, battebilly, apon318, adelepazani, reizak, fantasycrypto, kggymlife, maxwellmarcusart, jennyferandtony, mercurial9, gonklavez9, jesus-son, marc-allaria, didic, frissonsteemit, quinnertronics, blingit, the-burn, neneandy, photohunt, flyerchen, honeycup-waters, double-negative, schoolforsdg4, alvinauh, broncofan99, anneporter, nyxlabs, justyy, punchline, videosteemit, therising, marivic10, steemstorage, trippymane, logen9f, abdul-qudus, street.curator, ayamihaya, gordon92, qberry, hairgistix, bluemaskman, seinkalar, iskafan, allentaylor, chasmic-cosm, aboutyourbiz, notb4mycoffee, bscrypto, autobodhi, danokoroafor, tanzil2024, finch97, pinkchic, steemwizards, nerdnews, vera-vaders-ea, silverwhale, hanshotfirst-sm, gunthertopp, redrica, tazbaz, dejan.vuckovic, marcolino76, limn, mayllerlys, torico, netzisde, cosplay.hadr, archangel21, slickhustler007, amberyooper, yoghurt, foxyspirit, edencourage, benbow2017, windail1, baboz, johndeeback, jayna, circleoffriends, nateaguila, h-hamilton, annabeth, pipiczech, minnowpowerup, phgnomo, sawyn, esteliopadilla, the-grandmaster, detlev, stayoutoftherz, hive-bulgaria, arunava, stickchumpion, helyorsini, sergiomendes, tristancarax, bartosz546, myach, onemedia, ilovecryptopl, the.success.club, koychev22, literalypotato, mihaylov, projectmamabg, snedeva, badge-646464, diyan3973lenkov, mugueto2022, idksamad78699, derosnec, veeart, bubblegif, bambinaacida, vasilev89, zerotoone, sam99, superlotto, dawnoner, miko67, tfeldman, investingpennies, stahlberg, epicdice, aicu, dmoonfire, neumannsalva, zyx066, jjerryhan, hadrgames, drricksanchez, gabrielatravels, vietthuy, metroair, deanlogic, martibis, therealwolf, lilianajimenez, communitybank, sportscontest, goblinknackers, merlin7, sweetval, holoferncro, acantoni, pogier, stefy.music, simonpeter35, anafae, smartsteem, ausbit.dev, tinyhousecryptos, rmach, mcsvi, firstamendment, zest, jude9, ibt-survival, elevator09, sanderjansenart, revueh, forykw, mproxima, primersion, mafufuma, vixmemon, hiddendragon, robibasa, reggaesteem, hivecoffee, mirteg, martinthemass, vancouverdining, florenceboens, bambukah, cookaiss, grapthar, pladozero, atheistrepublic, portsundries, lightpaintershub, cryptictruth, goodcontentbot1, jerrybanfield, alt3r, smariam, bigtakosensei, joeyarnoldvn, lordvader, juecoree, stem-espanol, lorenzor, ufv, iamphysical, sandracarrascal, ydavgonzalez, miguelangel2801, delpilar, elvigia, josedelacruz, andrick, reinaseq, aleestra, giulyfarci52, azulear, technicalside, tomastonyperez, erickyoussif, acont, uche-nna, fran.frey, sevenoh-fiveoh, hk-curation, hashkings, pepeymeli, galdor100max, nahuelgameplays, infernalcoliseum, rondonshneezy, fefe99, psicoluigi, peaceandwar, yjcps, fatkat, ubaldonet, walterprofe, drifter1, buttcoins, cordeta, mariusfebruary, alvin0617, thelogicaldude, aaronkroeblinger, lettinggotech, danaedwards, shinedojo, vegan.niinja, scruffy23, realblockchain, balvinder294, beerlover, sardrt, marcoriccardi, dandays, gribouille, kieranstone, vaultec, nfttunz, eric-boucher, afifa, robertbira, eliaschess333, nicole-st, imcore, amansharma555, lk666, chrisdavidphoto, m1alsan, nwjordan, cyprianj, gifty-e, ennyta, endopediatria, iliyan90, alicewonderyoga, theargirova, iliev26, ississ89, velinov86, tbabachev, dontcare89, roflie, bluefinstudios, joseluis91, janetfund, hive-144994, careassaktart, xmauron3, photographercr, hivebuzz, lizanomadsoul, manncpt, jnmarteau, crypticat, steemitboard, gamersclassified, preciouz-01, kazirahul12, roelandp, eturnerx, fatman, votehero, tomiscurious, investegg, thefoundation, fourfourfun, rafaelaquino, olubunmiakinmade, gabrielr29,