How to use “pass” statement?

Suppose you are designing a new class with some methods that you don’t want to implement, yet. class MyClass(object): def meth_a(self): pass def meth_b(self): print “I’m meth_b” If you were to leave out the pass, the code wouldn’t run. You would then get an: IndentationError: expected an indented block To summarize, the pass statement does … Read more

“assert” statement with or without parentheses

The last assert would have given you a warning (SyntaxWarning: assertion is always true, perhaps remove parentheses?) if you ran it through a full interpreter, not through IDLE. Because assert is a keyword and not a function, you are actually passing in a tuple as the first argument and leaving off the second argument. Recall … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)