Test Informed Learning with Examples

Logo

Repository with assignments using the Test Informed Learning with Examples (TILE) method to integrate testing into existing programming courses for free.

Menu

LinkedIN Community

Join our LinkedIN Community.

Cite this work

Use the following BibTeX entry to cite this work:

@INPROCEEDINGS{DVMB2023,
  author={Doorn, Niels and Vos, Tanja and MarĂ­n, Beatriz and Barendsen, Erik},
  booktitle={2023 IEEE Conference on Software Testing, Verification and Validation (ICST)}, 
  title={Set the right example when teaching programming: Test Informed Learning with Examples (TILE)}, 
  year={2023},
  volume={},
  number={},
  pages={269-280},
  doi={10.1109/ICST57152.2023.00033}
}

Intersecting two sets

Write a tuple_inter function that receives two sets. The function must return a tuple that contains the intersection of the two sets and the result of erasing the intersection in the first set.

For example you can test your function with:

>>> firstSet  = {23, 42, 65, 57, 78, 83, 29}
>>> secondSet = {57, 83, 29, 67, 73, 43, 48}

>>> tuple_inter(firstSet, secondSet)
    ({57, 83, 29}, {65, 42, 78, 23})
>>> tuple_inter(firstSet, firstSet)
    ({65, 83, 23, 57, 42, 29, 78}, set())
>>> tuple_inter(set(), set())
    (set(), set())