0
question about assertion
I learn python at start ,and I don't know how to use assertion!
2 odpowiedzi
0
Assert instruction raises AssertionError exception depending on some condition.
In this example:
`assert 2 > 3, "Error!"`
you assert that two is greater than three. This assertion fails and exception with "Error!" text is raised.
Assertion is commonly used in testing. You won't use it often.
0
Wow, thanks very much,I know what is assert and i konw it is not often to be used