Base Types

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import unittest
import sys
from dataclasses import dataclass
from typing import *
sys.setrecursionlimit(10**6)

## Meta-comments begin with two hashes. These are comments about the
## direct content, which appears in code and with single hashes.

## This file illustrates the definition of functions that use
## built-in types.

## Files should check as "clean" with MyPy, or a related tool.

## every function must have a purpose statement.
## every function must have input and output types fully specified.

# does this person's age make it legal to obtain a driver's license?
def can_get_drivers_license(age : int) -> bool :
    return age > 15

## every function must have tests. These tests should be associated
## with complete code coverage.

class MyTests(unittest.TestCase):
    def test_1(self):
        self.assertEqual(True,can_get_drivers_license(22))
        self.assertEqual(False,can_get_drivers_license(15))