kamikaze/python-practics — Issue #1: Too many IFs
Author: kamikaze
Created: 2012-01-19 14:46:09+00:00
State: open

Your code contains too many independent IF conditions. This is not optimal.
Example:

```python
if i > b:
print('This number is greater than 20!')
if i < b:
print('This number is less than 20!')
if i == b:
print('This is exactly 20!')
```

If i is greater than b, then your code will print a message. AND THEN will check if i is less than b and even after that will check if i equals to b. Is it possible that i is greater than b and less than b in the same moment? I think no. So you need to skip unneeded checks when on of conditions is True.

Hint: Try to learn more about if statements here: http://docs.python.org/py3k/tutorial/controlflow.html#if-statements