There is a difference when I use assert and raised ValuError, why?
The following code, only stop my script when I use raise ValueError
, assert
does not work.
assert (len(dictA) != len(dictB)), 'Your have an .... error'
if len(dictA) != len(dictB):
raise ValueError('Your have an ... error')