def sum(a, b):
    return a+b

#You test this before using it in a large project:
print 17+4
print sum(17, 4)

"""
Explanation: Unit-tests
Unit-tests are not only a Python-specific concept, but a general paradigm to automate testing your code.
When writing a program (or a milestone for a larger program) you usually have a certain goal in mind, and you will want to confirm that your code actually reaches this goal. To do so you usually test your code manually at first.
End of explanation
"""


def sum(a, b):
    return a+b

print 17+4 == sum(17, 4)

"""
Explanation: By comparing the result with the expected result, you can quickly check, whether your method is correct. However you cannot be sure, whether this works for every input in the sense that you didn't test it. So in practice one verifies code for several exemplary inputs and tries to catch all edgy cases. Keep that in mind, but note that this section is about automating testing; proper test-design is a topic for itself.
If the code is complex, much more output might be needed to check correctness. So it pays off to automate the process of checking this. For instance you could do the following:
End of explanation
"""


