Skip to content
Advertisement

Tag: statements

“assert” statement with or without parentheses

Here are four simple invocations of assert: Note that the last one does not raise an error. What is the difference between calling assert with or without parenthesis that causes this behavior? My practice is to use parenthesis, but the above suggests that I should not. Answer The last assert would have given you a warning (SyntaxWarning: assertion is always

Advertisement