What does this if .. and not statement mean?
What does the following code mean: if next == "taunt bear" and not bear_moved bear_moved is filled with a value of false. I've read this post: What does this "if" statement mean? It explains that and 'and' operator tests for truth on both sides. If so, then does this code say, if next is equal to "taunt bear" and bear_moved is not true?
It's checking to see if next is equal to "taunt bear" and checking if bear_moved is falsey (a falsey value means it evaluates to false, truthy means it will evaluate to true). So as long as next is equal to "taunt bear" and bear_moved if not truthy, the if statement will succeed.
It is using the Boolean operator "and" so both expressions have to be true in order for the if statement to execute So if next has to equal "taunt bear" and also next has to equal not bear moved. Not bear moved is just the opposite of bear moved or you can say not bear moved means False whereas bear moved is True. It may help to look up Truth Tables in python.
numpy testing assert array NOT equal
How to join threads of an asyncio executor runned inside coroutine?
Google Admin SDK insert custom schema using python
Importing images for manifold Isomap
Having nosetests watch files from outside container and rerun tests inside container
Trying to ftp from my system to remote server
Attribute in a Class immediately runs at the wrong time?
Unable to handle “HTTP Badstatus line” exception
How to merge/join two resultset/table in django?
Maximise the Slope using CVXPY
Python-Instagram user_recent_media returning next of none
Django - AttributeError: 'module' object has no attribute 'admin'
Convert pandas (python) categorical x-axis to continuous values when plotting
How to make a specific type of python face tracker
OSError when trying to delete keys from redis
remove/reset matplotlib quiver arrows