Problem Statement
When should you use 'assert' instead of raising a ValueError?
Explanation
Assertions are for internal sanity checks that can be disabled with the optimize flag. They document assumptions for developers.
For user input and runtime validation, raise explicit exceptions so checks are always active.
Code Solution
SolutionRead Only
def area(r):
assert r >= 0
return 3.14*r*r