Recently, I solve competitive programming problems with Python3 and then I have tripped over the trick of this post’s title.
So I explain what does it mean.
0is evaluated as
Falseand other numeric is evaluated as
Truein condition like
When I tried to connect to MySQL via Python3 program, I encountered problem above.
At first, I had surely installed
mysql-connector-python before running the program.
pip3 install mysql-connector-python(For readability, added line feed to each row)Requirement already satisfied: mysql-connector-python in /opt/pypy3.6-v7.1.1-osx64/site-packages (8.0.17)Requirement already satisfied: protobuf>=3.0.0 in /opt/pypy3.6-v7.1.1-osx64/site-packages …