Ad
  • Custom User Avatar

    You actually can assign a function to variable https://www.geeksforgeeks.org/assign-function-to-a-variable-in-python/ , however you can't assign a function DEFINITION to variable. But once again im saying this is not my code where the error occurs, error lies in the test cases.

  • Custom User Avatar

    You can't assign function to a variable, you can call a function and store its return to a vaiable but not declare the function in the variable it self.

  • Custom User Avatar

    Went into comments just to say that, thanks dude for doing the work for me.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    no, you should look up how to define a function in python again: there is absolutely no way, that your def is at the beginning of the line when you have maze = just in front of it... ;)

    maze = def maze_runner(maze, directions):
    #^^^^^^  cough!
    
  • Custom User Avatar

    Hi,
    my def is in fact at the very beginning of the line, I've marked this as an issue, beacouse I think there is a problem with test.py test file, not my solution, and not something I could change.

  • Custom User Avatar

    Hi,

    not an issue. Issues are for problems in the code of the kata. Here, your code is using invalid syntax => that's a "Question".

    about that problem of yours: when used, def has to be at the very beginning of the line (according to the current indentation level)

    Cheers

  • Custom User Avatar
    File "tests.py", line 6
        maze = def maze_runner(maze, directions):
               ^
    SyntaxError: invalid syntax
    

    I am getting this error, and I am almost sure this is not my bad, any ideas?