Variable declared and assigned at global scope is undefined when called by a nested return function

Advertisements When a function is created inside a function, the following code is returning a string with the name variable coming back as undefined. Since this is functionally scoped inside the global scope, I would have expected the name variable from the global scope to be found and used. Is the issue that parameter naming… Read More Variable declared and assigned at global scope is undefined when called by a nested return function

Kotlin "variable expected" error when doing assignment to Array element

Advertisements I’m writing the following nested function where dfsVisit uses the arrays "numCaminos" and "colores" declared in the outer function However the kotlin compiler is giving me a "variable expected" error on the assignments in lines 31 and 34 specifically, this error doesn’t show up on any of the other Array assignments within the nested… Read More Kotlin "variable expected" error when doing assignment to Array element

I am using a function to call another function. When return the value, I am getting: 'NoneType' object is not subscriptable

Advertisements I am using a function to call another function. When I run the code, I am getting: ‘NoneType’ object is not subscriptable How can I get the return value and print them? e.g ) I run the code , a = equation 2 , b = 10 , c = 2 This will enter… Read More I am using a function to call another function. When return the value, I am getting: 'NoneType' object is not subscriptable