<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="category">
    <category><text>$course$/top/CodeLab Starter/Python Fundamentals</text></category>
  </question>
  <question type="codelab">
    <name><text>01. Sum of two integers</text></name>
    <questiontext format="html"><text><![CDATA[<p>Read two integers on separate lines and print their sum.</p>]]></text></questiontext>
    <generalfeedback format="html"><text></text></generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.1000000</penalty>
    <hidden>0</hidden>
    <language>python</language>
    <template>a = int(input())
b = int(input())
</template>
    <solution>a = int(input())
b = int(input())
print(a + b)
</solution>
    <prefix></prefix>
    <suffix></suffix>
    <tests>[{"stdin":"3\n5\n","expected":"8\n","code":"","hidden":false,"weight":1},{"stdin":"-4\n10\n","expected":"6\n","code":"","hidden":false,"weight":1},{"stdin":"0\n0\n","expected":"0\n","code":"","hidden":true,"weight":1}]</tests>
    <showtests>1</showtests>
    <comparison>spaces</comparison>
    <tolerance>0.001</tolerance>
    <cputime>0</cputime>
    <memorylimit>0</memorylimit>
    <noassist>0</noassist>
    <parsons>0</parsons>
    <distractors></distractors>
    <aihints>0</aihints>
    <timelimit>0</timelimit>
    <ordercheck>0</ordercheck>
    <files>[]</files>
    <gaps>0</gaps>
    <compiler></compiler>
    <std></std>
    <rules></rules>
  </question>
  <question type="codelab">
    <name><text>02. Even or odd</text></name>
    <questiontext format="html"><text><![CDATA[<p>Read an integer <code>n</code> and print <code>even</code> if it is divisible by 2, otherwise <code>odd</code>.</p>]]></text></questiontext>
    <generalfeedback format="html"><text></text></generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.1000000</penalty>
    <hidden>0</hidden>
    <language>python</language>
    <template></template>
    <solution>n = int(input())
print("even" if n % 2 == 0 else "odd")
</solution>
    <prefix></prefix>
    <suffix></suffix>
    <tests>[{"stdin":"4\n","expected":"even\n","code":"","hidden":false,"weight":1},{"stdin":"7\n","expected":"odd\n","code":"","hidden":false,"weight":1},{"stdin":"0\n","expected":"even\n","code":"","hidden":true,"weight":1},{"stdin":"-3\n","expected":"odd\n","code":"","hidden":true,"weight":1}]</tests>
    <showtests>1</showtests>
    <comparison>spaces</comparison>
    <tolerance>0.001</tolerance>
    <cputime>0</cputime>
    <memorylimit>0</memorylimit>
    <noassist>0</noassist>
    <parsons>0</parsons>
    <distractors></distractors>
    <aihints>0</aihints>
    <timelimit>0</timelimit>
    <ordercheck>0</ordercheck>
    <files>[]</files>
    <gaps>0</gaps>
    <compiler></compiler>
    <std></std>
    <rules></rules>
  </question>
  <question type="codelab">
    <name><text>03. Sum of digits</text></name>
    <questiontext format="html"><text><![CDATA[<p>Read a non-negative integer <code>n</code> and print the sum of its digits.</p>]]></text></questiontext>
    <generalfeedback format="html"><text></text></generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.1000000</penalty>
    <hidden>0</hidden>
    <language>python</language>
    <template></template>
    <solution>n = int(input())
s = 0
while n &gt; 0:
    s += n % 10
    n //= 10
print(s)
</solution>
    <prefix></prefix>
    <suffix></suffix>
    <tests>[{"stdin":"123\n","expected":"6\n","code":"","hidden":false,"weight":1},{"stdin":"9045\n","expected":"18\n","code":"","hidden":false,"weight":1},{"stdin":"0\n","expected":"0\n","code":"","hidden":true,"weight":2}]</tests>
    <showtests>1</showtests>
    <comparison>spaces</comparison>
    <tolerance>0.001</tolerance>
    <cputime>0</cputime>
    <memorylimit>0</memorylimit>
    <noassist>0</noassist>
    <parsons>0</parsons>
    <distractors></distractors>
    <aihints>0</aihints>
    <timelimit>0</timelimit>
    <ordercheck>0</ordercheck>
    <files>[]</files>
    <gaps>0</gaps>
    <compiler></compiler>
    <std></std>
    <rules></rules>
  </question>
  <question type="codelab">
    <name><text>04. Count vowels</text></name>
    <questiontext format="html"><text><![CDATA[<p>Read a line of text and print how many English vowels (<code>a, e, i, o, u</code>, case-insensitive) it contains.</p>]]></text></questiontext>
    <generalfeedback format="html"><text></text></generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.1000000</penalty>
    <hidden>0</hidden>
    <language>python</language>
    <template></template>
    <solution>s = input().lower()
print(sum(1 for ch in s if ch in "aeiou"))
</solution>
    <prefix></prefix>
    <suffix></suffix>
    <tests>[{"stdin":"Hello World\n","expected":"3\n","code":"","hidden":false,"weight":1},{"stdin":"Python\n","expected":"1\n","code":"","hidden":false,"weight":1},{"stdin":"AEIOUaeiou\n","expected":"10\n","code":"","hidden":true,"weight":1}]</tests>
    <showtests>1</showtests>
    <comparison>spaces</comparison>
    <tolerance>0.001</tolerance>
    <cputime>0</cputime>
    <memorylimit>0</memorylimit>
    <noassist>0</noassist>
    <parsons>0</parsons>
    <distractors></distractors>
    <aihints>0</aihints>
    <timelimit>0</timelimit>
    <ordercheck>0</ordercheck>
    <files>[]</files>
    <gaps>0</gaps>
    <compiler></compiler>
    <std></std>
    <rules></rules>
  </question>
  <question type="codelab">
    <name><text>05. Reverse words</text></name>
    <questiontext format="html"><text><![CDATA[<p>Read a line of words separated by spaces and print the words in reverse order.</p>]]></text></questiontext>
    <generalfeedback format="html"><text></text></generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.1000000</penalty>
    <hidden>0</hidden>
    <language>python</language>
    <template></template>
    <solution>words = input().split()
print(" ".join(reversed(words)))
</solution>
    <prefix></prefix>
    <suffix></suffix>
    <tests>[{"stdin":"one two three\n","expected":"three two one\n","code":"","hidden":false,"weight":1},{"stdin":"CodeLab\n","expected":"CodeLab\n","code":"","hidden":false,"weight":1},{"stdin":"a b c d\n","expected":"d c b a\n","code":"","hidden":true,"weight":1}]</tests>
    <showtests>1</showtests>
    <comparison>spaces</comparison>
    <tolerance>0.001</tolerance>
    <cputime>0</cputime>
    <memorylimit>0</memorylimit>
    <noassist>0</noassist>
    <parsons>0</parsons>
    <distractors></distractors>
    <aihints>0</aihints>
    <timelimit>0</timelimit>
    <ordercheck>0</ordercheck>
    <files>[]</files>
    <gaps>0</gaps>
    <compiler></compiler>
    <std></std>
    <rules></rules>
  </question>
  <question type="codelab">
    <name><text>06. Average with tolerance</text></name>
    <questiontext format="html"><text><![CDATA[<p>Read space-separated real numbers on one line and print their arithmetic mean.</p>]]></text></questiontext>
    <generalfeedback format="html"><text></text></generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.1000000</penalty>
    <hidden>0</hidden>
    <language>python</language>
    <template></template>
    <solution>nums = list(map(float, input().split()))
print(sum(nums) / len(nums))
</solution>
    <prefix></prefix>
    <suffix></suffix>
    <tests>[{"stdin":"1 2 4\n","expected":"2.3333333333333335\n","code":"","hidden":false,"weight":1},{"stdin":"2.5 3.5\n","expected":"3.0\n","code":"","hidden":false,"weight":1},{"stdin":"7\n","expected":"7.0\n","code":"","hidden":true,"weight":1}]</tests>
    <showtests>1</showtests>
    <comparison>numbers</comparison>
    <tolerance>0.001</tolerance>
    <cputime>0</cputime>
    <memorylimit>0</memorylimit>
    <noassist>0</noassist>
    <parsons>0</parsons>
    <distractors></distractors>
    <aihints>0</aihints>
    <timelimit>0</timelimit>
    <ordercheck>0</ordercheck>
    <files>[]</files>
    <gaps>0</gaps>
    <compiler></compiler>
    <std></std>
    <rules></rules>
  </question>
  <question type="codelab">
    <name><text>07. Any two-digit even number (regex)</text></name>
    <questiontext format="html"><text><![CDATA[<p>Print any two-digit even integer from 10 to 98.</p>]]></text></questiontext>
    <generalfeedback format="html"><text></text></generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.1000000</penalty>
    <hidden>0</hidden>
    <language>python</language>
    <template></template>
    <solution>print(42)
</solution>
    <prefix></prefix>
    <suffix></suffix>
    <tests>[{"stdin":"","expected":"[1-9][02468]\\n?","code":"","hidden":false,"weight":1}]</tests>
    <showtests>1</showtests>
    <comparison>regex</comparison>
    <tolerance>0.001</tolerance>
    <cputime>0</cputime>
    <memorylimit>0</memorylimit>
    <noassist>0</noassist>
    <parsons>0</parsons>
    <distractors></distractors>
    <aihints>0</aihints>
    <timelimit>0</timelimit>
    <ordercheck>0</ordercheck>
    <files>[]</files>
    <gaps>0</gaps>
    <compiler></compiler>
    <std></std>
    <rules></rules>
  </question>
  <question type="codelab">
    <name><text>08. Factorial (Parsons problem)</text></name>
    <questiontext format="html"><text><![CDATA[<p>Arrange and indent the lines to read <code>n</code> and print <code>n!</code>. Ignore the two distractor lines.</p>]]></text></questiontext>
    <generalfeedback format="html"><text></text></generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.1000000</penalty>
    <hidden>0</hidden>
    <language>python</language>
    <template></template>
    <solution>n = int(input())
f = 1
for i in range(2, n + 1):
    f *= i
print(f)
</solution>
    <prefix></prefix>
    <suffix></suffix>
    <tests>[{"stdin":"5\n","expected":"120\n","code":"","hidden":false,"weight":1},{"stdin":"1\n","expected":"1\n","code":"","hidden":false,"weight":1},{"stdin":"7\n","expected":"5040\n","code":"","hidden":true,"weight":1}]</tests>
    <showtests>1</showtests>
    <comparison>spaces</comparison>
    <tolerance>0.001</tolerance>
    <cputime>0</cputime>
    <memorylimit>0</memorylimit>
    <noassist>0</noassist>
    <parsons>1</parsons>
    <distractors>f = 0
for i in range(n):
</distractors>
    <aihints>0</aihints>
    <timelimit>0</timelimit>
    <ordercheck>0</ordercheck>
    <files>[]</files>
    <gaps>0</gaps>
    <compiler></compiler>
    <std></std>
    <rules></rules>
  </question>
  <question type="codelab">
    <name><text>09. Largest number without max/sort (constraints)</text></name>
    <questiontext format="html"><text><![CDATA[<p>Read space-separated integers on one line and print the largest one using a <code>for</code> loop, without using <code>max</code>, <code>sort</code> or <code>sorted</code>.</p>]]></text></questiontext>
    <generalfeedback format="html"><text></text></generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.1000000</penalty>
    <hidden>0</hidden>
    <language>python</language>
    <template>nums = list(map(int, input().split()))
</template>
    <solution>nums = list(map(int, input().split()))
best = nums[0]
for x in nums[1:]:
    if x &gt; best:
        best = x
print(best)
</solution>
    <prefix></prefix>
    <suffix></suffix>
    <tests>[{"stdin":"3 9 4 1\n","expected":"9\n","code":"","hidden":false,"weight":1},{"stdin":"-5 -2 -10\n","expected":"-2\n","code":"","hidden":false,"weight":1},{"stdin":"42\n","expected":"42\n","code":"","hidden":true,"weight":1}]</tests>
    <showtests>1</showtests>
    <comparison>spaces</comparison>
    <tolerance>0.001</tolerance>
    <cputime>0</cputime>
    <memorylimit>0</memorylimit>
    <noassist>0</noassist>
    <parsons>0</parsons>
    <distractors></distractors>
    <aihints>0</aihints>
    <timelimit>0</timelimit>
    <ordercheck>0</ordercheck>
    <files>[]</files>
    <gaps>0</gaps>
    <compiler></compiler>
    <std></std>
    <rules>{"forbid":["max","sort","sorted"],"require":["for"],"penalty":50}</rules>
  </question>
  <question type="codelab">
    <name><text>10. Prime count (time limit)</text></name>
    <questiontext format="html"><text><![CDATA[<p>Read <code>n</code> (&le; 200&nbsp;000) and print how many prime numbers are &le; <code>n</code>.</p>]]></text></questiontext>
    <generalfeedback format="html"><text></text></generalfeedback>
    <defaultgrade>1.0000000</defaultgrade>
    <penalty>0.1000000</penalty>
    <hidden>0</hidden>
    <language>python</language>
    <template></template>
    <solution>n = int(input())
sieve = [True] * (n + 1)
count = 0
for i in range(2, n + 1):
    if sieve[i]:
        count += 1
        for j in range(i * i, n + 1, i):
            sieve[j] = False
print(count)
</solution>
    <prefix></prefix>
    <suffix></suffix>
    <tests>[{"stdin":"10\n","expected":"4\n","code":"","hidden":false,"weight":1},{"stdin":"100\n","expected":"25\n","code":"","hidden":false,"weight":1},{"stdin":"200000\n","expected":"17984\n","code":"","hidden":true,"weight":1}]</tests>
    <showtests>1</showtests>
    <comparison>spaces</comparison>
    <tolerance>0.001</tolerance>
    <cputime>2</cputime>
    <memorylimit>0</memorylimit>
    <noassist>0</noassist>
    <parsons>0</parsons>
    <distractors></distractors>
    <aihints>0</aihints>
    <timelimit>0</timelimit>
    <ordercheck>0</ordercheck>
    <files>[]</files>
    <gaps>0</gaps>
    <compiler></compiler>
    <std></std>
    <rules></rules>
  </question>
</quiz>
