raise Assertionerror vs. assert python
问题 What are the big differences between raise Assertionerror and assert to build in a "fault". What are the effects on the code ? and is one or the other more pythonic in a way ? The reason for my question is because I am learning to program right now we have exercise where for example when x != "ok" (x be a certain number) we need to get an AssertionError "false". I looked this up online and then they say to set the following code: if x != 0: raise AssertionError ("false") but my teachers also