<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="category">
    <category>
      <text>$course$/top/OnlineCompiler.io Python (español)</text>
    </category>
    <info format="html">
      <text><![CDATA[<p>Preguntas CodeRunner gratis de OnlineCompiler.io (https://onlinecompiler.io/es/banco-de-preguntas-coderunner), con licencia CC BY 4.0. Usan los tipos de pregunta que ya trae CodeRunner, así que funcionan en cualquier servidor Jobe.</p>]]></text>
    </info>
    <idnumber></idnumber>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Suma y diferencia]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Escribe un programa que lea dos enteros, uno por línea, e imprima su suma en la primera línea y su diferencia (el primero menos el segundo) en la segunda línea.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[a = int(input())
b = int(input())
print(a + b)
print(a - b)
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[7
3
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[10
4]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[-5
12
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[7
-17]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[0
0
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[0
0]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[-8
-20
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[-28
12]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>io</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Segundos a H:MM:SS]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Escribe un programa que lea un número entero de segundos (0 o más) y lo imprima como horas, minutos y segundos con el formato <code>H:MM:SS</code>. Los minutos y los segundos siempre tienen dos dígitos; las horas no llevan ceros a la izquierda y pueden pasar de 24. Por ejemplo, <code>3725</code> imprime <code>1:02:05</code>.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[total = int(input())
hours = total // 3600
minutes = total % 3600 // 60
seconds = total % 60
print(f"{hours}:{minutes:02d}:{seconds:02d}")
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[3725
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[1:02:05]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[59
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[0:00:59]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[600
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[0:10:00]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[0
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[0:00:00]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[90061
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[25:01:01]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>io</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Distancia entre dos puntos]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Escribe una función <code>distance(x1, y1, x2, y2)</code> que devuelva la distancia en línea recta entre los puntos (<code>x1</code>, <code>y1</code>) y (<code>x2</code>, <code>y2</code>), es decir, la raíz cuadrada de <code>(x2 - x1)**2 + (y2 - y1)**2</code>. Las coordenadas pueden ser negativas o tener decimales. Devuelve la distancia sin imprimirla; las pruebas la imprimen con dos decimales, así que <code>distance(0, 0, 3, 4)</code> aparece como <code>5.00</code>. Puedes usar <code>math.sqrt</code> después de <code>import math</code>.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[import math


def distance(x1, y1, x2, y2):
    dx = x2 - x1
    dy = y2 - y1
    return math.sqrt(dx * dx + dy * dy)
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(f"{distance(0, 0, 3, 4):.2f}")]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[5.00]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(f"{distance(1, 1, 1, 1):.2f}")]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[0.00]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(f"{distance(-1, -2, 2, 2):.2f}")]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[5.00]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(f"{distance(0, 0, 1, 1):.2f}")]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[1.41]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(f"{distance(-3, 5, 4, -1):.2f}")]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[9.22]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(f"{distance(0.5, 0, 0, 2.5):.2f}")]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[2.55]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>functions</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Precio de entrada por edad]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Un museo fija el precio de la entrada según la edad: los niños menores de 4 años entran gratis (precio 0), de 4 a 11 años pagan 8, de 12 a 59 años pagan 15 y las personas de 60 años o más pagan 10. Escribe una función <code>ticket_price(age)</code> que devuelva el precio para un visitante de esa edad. <code>age</code> es un número entero, 0 o más.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[def ticket_price(age):
    if age < 4:
        return 0
    elif age < 12:
        return 8
    elif age < 60:
        return 15
    else:
        return 10
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(ticket_price(30))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[15]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(ticket_price(7))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[8]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(ticket_price(3), ticket_price(4))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[0 8]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(ticket_price(11), ticket_price(12))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[8 15]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(ticket_price(59), ticket_price(60))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[15 10]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(ticket_price(0), ticket_price(95))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[0 10]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>conditionals</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Año bisiesto]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>En el calendario gregoriano, un año es bisiesto si es divisible entre 4, excepto los años divisibles entre 100, que solo son bisiestos si también son divisibles entre 400. Escribe una función <code>is_leap_year(year)</code> que devuelva <code>True</code> si <code>year</code> es bisiesto y <code>False</code> en caso contrario.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[def is_leap_year(year):
    if year % 400 == 0:
        return True
    elif year % 100 == 0:
        return False
    elif year % 4 == 0:
        return True
    else:
        return False
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(is_leap_year(2024))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[True]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(is_leap_year(2023))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[False]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(is_leap_year(1900))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[False]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(is_leap_year(2000))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[True]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(is_leap_year(2100), is_leap_year(1600), is_leap_year(1996))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[False True True]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>conditionals</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Cuadrante de un punto]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Escribe una función <code>quadrant(x, y)</code> que devuelva el cuadrante del plano donde está el punto (<code>x</code>, <code>y</code>): 1 cuando <code>x &gt; 0</code> y <code>y &gt; 0</code>, 2 cuando <code>x &lt; 0</code> y <code>y &gt; 0</code>, 3 cuando <code>x &lt; 0</code> y <code>y &lt; 0</code>, y 4 cuando <code>x &gt; 0</code> y <code>y &lt; 0</code>. Un punto sobre alguno de los ejes (<code>x</code> o <code>y</code> igual a 0) no está en ningún cuadrante: devuelve 0.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[def quadrant(x, y):
    if x > 0 and y > 0:
        return 1
    elif x < 0 and y > 0:
        return 2
    elif x < 0 and y < 0:
        return 3
    elif x > 0 and y < 0:
        return 4
    else:
        return 0
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(quadrant(3, 4))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[1]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(quadrant(-2, 5))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[2]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(quadrant(-1, -1))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[3]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(quadrant(0, -6))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[0]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(quadrant(7, -3), quadrant(-0.5, 2.5))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[4 2]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(quadrant(4, 0), quadrant(0, 0), quadrant(0, 9))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[0 0 0]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>conditionals</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Tabla de multiplicar]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Escribe un programa que lea un entero <i>n</i> e imprima la tabla de multiplicar de <i>n</i> del 1 al 10, una línea por multiplicación, con el formato <code>n x i = resultado</code> (una <code>x</code> minúscula, con un espacio a cada lado de la <code>x</code> y del <code>=</code>). Por ejemplo, para 7 la primera línea es <code>7 x 1 = 7</code> y la última es <code>7 x 10 = 70</code>. <i>n</i> puede ser cero o negativo.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[n = int(input())
for i in range(1, 11):
    print(f"{n} x {i} = {n * i}")
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[7
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[7 x 1 = 7
7 x 2 = 14
7 x 3 = 21
7 x 4 = 28
7 x 5 = 35
7 x 6 = 42
7 x 7 = 49
7 x 8 = 56
7 x 9 = 63
7 x 10 = 70]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[1
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[1 x 1 = 1
1 x 2 = 2
1 x 3 = 3
1 x 4 = 4
1 x 5 = 5
1 x 6 = 6
1 x 7 = 7
1 x 8 = 8
1 x 9 = 9
1 x 10 = 10]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[-3
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[-3 x 1 = -3
-3 x 2 = -6
-3 x 3 = -9
-3 x 4 = -12
-3 x 5 = -15
-3 x 6 = -18
-3 x 7 = -21
-3 x 8 = -24
-3 x 9 = -27
-3 x 10 = -30]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[0
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[0 x 1 = 0
0 x 2 = 0
0 x 3 = 0
0 x 4 = 0
0 x 5 = 0
0 x 6 = 0
0 x 7 = 0
0 x 8 = 0
0 x 9 = 0
0 x 10 = 0]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[12
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[12 x 1 = 12
12 x 2 = 24
12 x 3 = 36
12 x 4 = 48
12 x 5 = 60
12 x 6 = 72
12 x 7 = 84
12 x 8 = 96
12 x 9 = 108
12 x 10 = 120]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>loops</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Suma de los dígitos]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Escribe una función <code>digit_sum(n)</code> que devuelva la suma de los dígitos del entero <code>n</code>. Para un número negativo, suma los dígitos de su valor absoluto; <code>digit_sum(0)</code> es 0. Usa un ciclo <code>while</code> con <code>% 10</code> (el último dígito) y <code>// 10</code> (quita el último dígito) en lugar de convertir el número en cadena.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[def digit_sum(n):
    n = abs(n)
    total = 0
    while n > 0:
        total += n % 10
        n = n // 10
    return total
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(digit_sum(1234))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[10]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(digit_sum(7))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[7]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(digit_sum(0))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[0]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(digit_sum(1000000))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[1]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(digit_sum(-507))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[12]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(digit_sum(99999))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[45]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>loops</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Pasos de Collatz]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>A partir de un entero positivo <code>n</code>, repite este paso hasta que el número llegue a 1: si es par, divídelo entre 2; si es impar, multiplícalo por 3 y súmale 1. Escribe una función <code>collatz_steps(n)</code> que devuelva cuántos pasos hacen falta. Por ejemplo, 6 pasa por 6, 3, 10, 5, 16, 8, 4, 2, 1, es decir, 8 pasos; <code>collatz_steps(1)</code> es 0.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[def collatz_steps(n):
    steps = 0
    while n != 1:
        if n % 2 == 0:
            n = n // 2
        else:
            n = 3 * n + 1
        steps += 1
    return steps
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(collatz_steps(6))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[8]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(collatz_steps(1))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[0]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(collatz_steps(2))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[1]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(collatz_steps(7))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[16]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(collatz_steps(27))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[111]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>loops</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Contar primos]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Escribe dos funciones. <code>is_prime(n)</code> devuelve <code>True</code> si el entero <code>n</code> es primo y <code>False</code> en caso contrario; los números menores que 2 (incluidos 0 y los negativos) no son primos. <code>count_primes(a, b)</code> devuelve cuántos primos hay de <code>a</code> a <code>b</code>, ambos incluidos, y debe usar <code>is_prime</code>; si <code>a</code> es mayor que <code>b</code>, devuelve 0.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[def is_prime(n):
    if n < 2:
        return False
    divisor = 2
    while divisor * divisor <= n:
        if n % divisor == 0:
            return False
        divisor += 1
    return True


def count_primes(a, b):
    count = 0
    for n in range(a, b + 1):
        if is_prime(n):
            count += 1
    return count
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(is_prime(7), is_prime(10))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[True False]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(count_primes(1, 10))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[4]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(is_prime(2), is_prime(1), is_prime(0), is_prime(-7))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[True False False False]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(count_primes(2, 13))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[6]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(is_prime(49), is_prime(97), is_prime(121))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[False True False]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(count_primes(20, 10), count_primes(24, 28), count_primes(-5, 3))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[0 0 2]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>functions</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Contar las vocales]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Escribe una función <code>count_vowels(text)</code> que devuelva cuántas vocales (a, e, i, o, u, mayúsculas o minúsculas) hay en <code>text</code>.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[def count_vowels(text):
    count = 0
    for ch in text.lower():
        if ch in "aeiou":
            count += 1
    return count
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(count_vowels("Hello World"))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[3]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(count_vowels("AEIOU aeiou"))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[10]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(count_vowels("rhythm"))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[0]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(count_vowels(""))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[0]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>strings</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[¿Es un palíndromo?]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Escribe una función <code>is_palindrome(text)</code> que devuelva <code>True</code> si <code>text</code> se lee igual de izquierda a derecha que de derecha a izquierda, y <code>False</code> en caso contrario. Solo cuentan las letras y los dígitos (los caracteres para los que <code>isalnum()</code> es verdadero), y las mayúsculas y minúsculas se consideran iguales, así que <code>"Anita lava la tina"</code> es un palíndromo. Una cadena sin letras ni dígitos, como <code>""</code>, es un palíndromo.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[def is_palindrome(text):
    cleaned = ""
    for ch in text.lower():
        if ch.isalnum():
            cleaned += ch
    return cleaned == cleaned[::-1]
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(is_palindrome("Reconocer"))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[True]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(is_palindrome("Python"))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[False]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(is_palindrome("Roma me tem amor"))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[True]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(is_palindrome("Anita lava la tina"))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[True]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(is_palindrome("1a2-2A1"), is_palindrome("ab"), is_palindrome("abca"))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[True False False]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(is_palindrome(""), is_palindrome("?! ."))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[True True]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>strings</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Cifrado César]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Escribe una función <code>caesar(text, shift)</code> que devuelva <code>text</code> cifrado con el cifrado César: cada letra de la <code>a</code> a la <code>z</code> y de la <code>A</code> a la <code>Z</code> avanza <code>shift</code> posiciones en el alfabeto, volviendo al principio después de la <code>z</code>; las mayúsculas siguen siendo mayúsculas y las minúsculas, minúsculas. Todos los demás caracteres (dígitos, espacios, signos de puntuación y letras como <code>ñ</code> o <code>é</code>) quedan igual. <code>shift</code> puede ser cualquier entero: los valores negativos hacen retroceder las letras, y 27 funciona como 1.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[def caesar(text, shift):
    result = ""
    for ch in text:
        if "a" <= ch <= "z":
            result += chr((ord(ch) - ord("a") + shift) % 26 + ord("a"))
        elif "A" <= ch <= "Z":
            result += chr((ord(ch) - ord("A") + shift) % 26 + ord("A"))
        else:
            result += ch
    return result
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(caesar("abc", 1))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[bcd]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(caesar("xyz XYZ", 3))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[abc ABC]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(caesar("Hola, Mundo 2026!", 5))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[Mtqf, Rzsit 2026!]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(caesar("abc", -1))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[zab]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(caesar("Ação", 2), caesar("Año", 1))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[Cçãq Bñp]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(caesar("Zebra", 27), caesar("Zebra", -52), len(caesar("", 4)))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[Afcsb Zebra 0]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>strings</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Suma acumulada]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Escribe una función <code>running_total(numbers)</code> que reciba una lista de números y devuelva una lista nueva, del mismo tamaño, en la que cada elemento es la suma de los elementos de <code>numbers</code> hasta esa posición, incluida. Por ejemplo, <code>running_total([1, 2, 3, 4])</code> devuelve <code>[1, 3, 6, 10]</code>. Una lista vacía da una lista vacía, y la lista original no debe modificarse.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[def running_total(numbers):
    totals = []
    total = 0
    for n in numbers:
        total += n
        totals.append(total)
    return totals
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(running_total([1, 2, 3, 4]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[1, 3, 6, 10]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(running_total([5]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[5]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(running_total([]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(running_total([3, -3, 3, -3]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[3, 0, 3, 0]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[nums = [2, 4, 6]
result = running_total(nums)
print(nums, result)]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[2, 4, 6] [2, 6, 12]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(running_total([10, 0, -5, 2.5]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[10, 10, 5, 7.5]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>lists</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Segundo mayor valor]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Escribe una función <code>second_largest(numbers)</code> que devuelva el segundo mayor valor distinto de la lista <code>numbers</code>. Los valores repetidos cuentan una sola vez, así que para <code>[5, 5, 3]</code> la respuesta es 3. Si la lista tiene menos de dos valores distintos (por ejemplo <code>[]</code> o <code>[7, 7]</code>), devuelve <code>None</code>. Los números pueden ser negativos. No modifiques la lista.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[def second_largest(numbers):
    largest = None
    second = None
    for n in numbers:
        if largest is None or n > largest:
            second = largest
            largest = n
        elif n < largest and (second is None or n > second):
            second = n
    return second
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(second_largest([3, 9, 4]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[4]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(second_largest([5, 5, 3]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[3]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(second_largest([7, 7]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[None]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(second_largest([-2, -8, -5]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[-5]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(second_largest([]), second_largest([4]), second_largest([1, 2, 2, 2]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[None None 1]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[nums = [3, 1, 2]
print(second_largest(nums), nums)]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[2 [3, 1, 2]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>lists</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Matriz transpuesta]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Una matriz se guarda como una lista de filas, cada fila una lista de números, todas del mismo largo. Escribe una función <code>transpose(matrix)</code> que devuelva una matriz nueva, como lista de listas, cuyas filas son las columnas de <code>matrix</code>: el elemento de la fila <i>i</i>, columna <i>j</i> pasa a la fila <i>j</i>, columna <i>i</i>. La matriz no tiene que ser cuadrada. Para la matriz vacía <code>[]</code>, devuelve <code>[]</code>.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[def transpose(matrix):
    if len(matrix) == 0:
        return []
    result = []
    for j in range(len(matrix[0])):
        new_row = []
        for row in matrix:
            new_row.append(row[j])
        result.append(new_row)
    return result
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(transpose([[1, 2], [3, 4]]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[[1, 3], [2, 4]]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(transpose([[1, 2, 3], [4, 5, 6]]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[[1, 4], [2, 5], [3, 6]]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(transpose([[7]]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[[7]]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(transpose([[1], [2], [3]]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[[1, 2, 3]]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(transpose([]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(transpose([[1, -2, 0, 4], [5, 6, 7, -8]]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[[1, 5], [-2, 6], [0, 7], [4, -8]]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>lists</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Contar palabras]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Escribe una función <code>count_words(text)</code> que devuelva un diccionario que asocie cada palabra de <code>text</code> con el número de veces que aparece. Las palabras están separadas por uno o más espacios (también puede haber espacios al principio o al final) y se comparan sin distinguir mayúsculas de minúsculas: guarda cada palabra en minúsculas. El texto no tiene signos de puntuación, y un texto vacío da un diccionario vacío. Las pruebas imprimen <code>sorted(count_words(text).items())</code>, así que el orden en que agregas las claves no importa.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[def count_words(text):
    counts = {}
    for word in text.lower().split():
        if word in counts:
            counts[word] += 1
        else:
            counts[word] = 1
    return counts
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(sorted(count_words("a b a c b a").items()))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[('a', 3), ('b', 2), ('c', 1)]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(sorted(count_words("Hola hola HOLA mundo").items()))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[('hola', 3), ('mundo', 1)]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(sorted(count_words("o gato viu o outro gato").items()))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[('gato', 2), ('o', 2), ('outro', 1), ('viu', 1)]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(sorted(count_words("").items()))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(sorted(count_words("  uno   dos  UNO ").items()))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[[('dos', 1), ('uno', 2)]]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>maps</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Ganador de la elección]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Escribe un programa que cuente votos. La primera línea de la entrada tiene el número de votos <i>n</i> (al menos 1), y cada una de las <i>n</i> líneas siguientes tiene el nombre de un candidato. Imprime el nombre del candidato con más votos, un espacio y su número de votos. Si hay empate entre los más votados, imprime el nombre que va primero en orden alfabético (los nombres son una sola palabra sin acentos, con la primera letra mayúscula y las demás minúsculas, así que compararlos con <code>&lt;</code> da ese orden). Usa un diccionario para contar.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[n = int(input())
votes = {}
for _ in range(n):
    name = input().strip()
    votes[name] = votes.get(name, 0) + 1

# Visit the names in alphabetical order and only replace the leader on
# strictly more votes, so a tie keeps the name that comes first.
winner = None
for name in sorted(votes):
    if winner is None or votes[name] > votes[winner]:
        winner = name
print(winner, votes[winner])
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[5
Ana
Bruno
Ana
Carla
Ana
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[Ana 3]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[4
Bruno
Ana
Bruno
Ana
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[Ana 2]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[1
Zeca
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[Zeca 1]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[7
Maria
Jose
Maria
Pedro
Jose
Maria
Pedro
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[Maria 3]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[6
Luis
Marta
Luis
Marta
Diego
Diego
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[Diego 2]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text></text>
        </testcode>
        <stdin>
          <text><![CDATA[5
Teo
Sofia
Teo
Sofia
Teo
]]></text>
        </stdin>
        <expected>
          <text><![CDATA[Teo 3]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>maps</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Suma de una lista anidada]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Una lista anidada es una lista cuyos elementos son enteros u otras listas anidadas, a cualquier profundidad, como <code>[1, [2, 3], [[4]], 5]</code>. Escribe una función recursiva <code>nested_sum(items)</code> que devuelva la suma de todos los enteros dentro de <code>items</code>, en todos los niveles. Las listas vacías no suman nada, así que <code>nested_sum([])</code> es 0. Pista: <code>isinstance(x, list)</code> indica si <code>x</code> es una lista.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[def nested_sum(items):
    total = 0
    for item in items:
        if isinstance(item, list):
            total += nested_sum(item)
        else:
            total += item
    return total
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(nested_sum([1, [2, 3], [[4]], 5]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[15]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(nested_sum([1, 2, 3]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[6]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(nested_sum([]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[0]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(nested_sum([-1, [-2, [3]]]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[0]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(nested_sum([[], [[]], []]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[0]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(nested_sum([[1, [2, [3, [4, [5]]]]], 10]))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[25]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>recursion</text></tag>
    </tags>
  </question>
  <question type="coderunner">
    <name>
      <text><![CDATA[Búsqueda binaria]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Escribe una función <code>binary_search(items, target)</code> que devuelva el índice de <code>target</code> en la lista <code>items</code>, o <code>-1</code> si no está. <code>items</code> está ordenada de menor a mayor, sin valores repetidos, y puede estar vacía. Usa búsqueda binaria: mantén el rango de índices donde <code>target</code> todavía puede estar, mira el elemento del medio y descarta la mitad que no puede contenerlo. No uses <code>items.index</code>, el operador <code>in</code> ni un ciclo que revise todos los elementos.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.0000000</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>python3</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>10, 20, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>15</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload></answerpreload>
    <globalextra></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template></template>
    <iscombinatortemplate></iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer><![CDATA[def binary_search(items, target):
    low = 0
    high = len(items) - 1
    while low <= high:
        middle = (low + high) // 2
        if items[middle] == target:
            return middle
        elif items[middle] < target:
            low = middle + 1
        else:
            high = middle - 1
    return -1
]]></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams></templateparams>
    <uiplugin></uiplugin>
    <attachments>0</attachments>
    <testcases>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(binary_search([1, 3, 5, 7, 9], 7))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[3]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(binary_search([1, 3, 5, 7, 9], 4))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[-1]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(binary_search([1, 3, 5, 7, 9], 1), binary_search([1, 3, 5, 7, 9], 9))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[0 4]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(binary_search([], 5), binary_search([42], 42), binary_search([42], 7))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[-1 0 -1]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[SHOW]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[evens = list(range(0, 1000, 2))
print(binary_search(evens, 998), binary_search(evens, 0), binary_search(evens, 500))
print(binary_search(evens, 501), binary_search(evens, -2), binary_search(evens, 1000))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[499 0 250
-1 -1 -1]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000">
        <testcode>
          <text><![CDATA[print(binary_search([-10, -3, 0, 8], -3), binary_search([-10, -3, 0, 8], 10))]]></text>
        </testcode>
        <stdin>
          <text></text>
        </stdin>
        <expected>
          <text><![CDATA[1 -1]]></text>
        </expected>
        <extra>
          <text></text>
        </extra>
        <display>
          <text><![CDATA[HIDE]]></text>
        </display>
      </testcase>
    </testcases>
    <tags>
      <tag><text>onlinecompiler.io</text></tag>
      <tag><text>python</text></tag>
      <tag><text>algorithms</text></tag>
    </tags>
  </question>
</quiz>
