Question: ```
# Given three ints, a b c, print True if b is greater than a,  
# and c is greater than b. However, with the exception that if 
# "bOk" is True, b does not need to be greater than a. 

a = int(input())
b = int(input())
c = int(input())
bOk = bool(input())

print(((bOk and c > b) or (b > a and c > b)))

```

My program works for all combinations besides "3 2 4 False"

I don't understand why it prints True for this combination. The first closed set should return False since bOk = False, and the second closed set should return False as well since b > a is False. 

Explanation would be much appreciated.

Answer: 
Comments and other answers already covered explanation of OPs mistake. I'll rather show how things are usually done in a more restricted context (production?).

Code is not fully tested and is not the most elegant though the point is: sanitize input. Always. And prompt user for choice questions (yes/no, true/false) in a completely different way.

In the below example bool prompt sanitized as "this value is the only value that is treated as True; all other values are False".

```
#!/usr/bin/env python
"""Just an example."""

def input_type(prompt, type_):
    """Prompt a user to input a certain type of data.

    For a sake of simplicity type_ is limited to int and str.

    :param prompt: prompt message to print
    :param type_:  type of a data required

    :type prompt:  str
    :type type_:   int or bool

    :return: data of a required type retrieved from STDIN
    :rtype:  type_
    """
    accepted_types = [int, str]
    if isinstance(prompt, str):
        if any(type_ == atype for atype in accepted_types):
            while True:
                user_input = input(prompt)
                try:
                    return type_(user_input)
                except ValueError:
                    continue
        else:
            errmsg = 'Requested type is unsupported by this function: %s'
            errmsg = errmsg % type_.__name__
    else:
        errmsg = 'Prompt must be a string: got %s instead'
        errmsg = errmsg % type(prompt).__name__

    raise Exception(errmsg)

def input_bool(prompt, as_true):
    """Prompt user to answer positively or negatively.

    :param prompt:  prompt message to print
    :param as_true: value to interpret as True

    :type prompt:  str
    :type as_true: str

    :return: user answer
    :rtype:  bool
    """
    if isinstance(as_true, str):
        return input_type(prompt, str) == as_true
    else:
        errmsg = "'as_true' argument must be a string: got %s instead"
        errmsg = errmsg % type(as_true).__name__

    raise Exception(errmsg)

if __name__ == '__main__':
    a = input_type('Enter first integer: ', int)
    b = input_type('Enter second integer: ', int)
    c = input_type('Enter third integer: ', int)
    bOk = input_bool('Enter boolean value (True/False): ', 'true')

    # Result
    print(((bOk and c > b) or (b > a and c > b)))

```

Hope that helps and sorry for such a huge listing. Processing user input is always a tricky task.
Your codes works on Python 2.x, because in Python 2.x, input() equals eval(raw\_input(prompt)).

```
>>> a=int(input())
3
>>> b=int(input())
2
>>> c=int(input())
4
>>> bOk=bool(input())
False
>>> print(bOk and c > b)
False
>>> bOk
False
>>> print(((bOk and c > b) or (b > a and c > b)))
False

```

But in Python 3.x, input() equals raw\_input(), so bOk equals bool("False"), equals True.

```
>>> bOk=bool(input())
False
>>> print(bOk and c > b)
True
>>> bOk
True

```

You can change input() to eval(input()).

"The Python 2 to 3 conversion tool will replace calls to input() with eval(input()) and raw\_input() with input()."

Refer to <https://www.python.org/dev/peps/pep-3111/>