Light Mode
Dark Mode
Bug in default `check_solution`

Line 35:

        if not isinstance(user_result, str) and user_result not in DIRS.keys():
            print("You should return a string with an action.")
            return False

If `user_result == ""` this block will not run. I think it's supposed to be `or` instead of `and`. But furthermore, the first condition is unnecessary, since `DIRS.keys()` contains only strings. You can just use the code like this:

        if user_result not in DIRS.keys():
            print("You should return a string with an action.")
            return False
Created: Nov. 27, 2014, 1:40 p.m.
Updated: Nov. 27, 2014, 1:50 p.m.
0
13
User avatar
DiEvAl_0d0e0434e59e45f68684d0e