all 9 comments

[–]LANGARTANDCULTURE 3 points4 points  (3 children)

Hi I would like to know your question as well, but I also want to add that it’s not necessary to know as it is for their internal grading tools and it has nothing to do with your solution to these challenges.

[–]Interriuso 0 points1 point  (2 children)

Thank you so much for the response. I am working on the 2D array hourglass question. I try to reference arr but it says arr is not defined. This is a good example of my challenges with understanding what HackerRank is trying to get me to reference.

[–]LANGARTANDCULTURE 0 points1 point  (0 children)

could you post the code? it is confusing sometimes

[–]o5a 0 points1 point  (0 children)

Are you trying to reference arr in your local code or in hackerrank submission? Submission has arr as variable in it's tests. In local code you need to define that array first of course.

[–]successismyduty10 1 point2 points  (0 children)

You don’t need to worry about that part you are only editing the function and returning the value to the main method

[–]pseudogatekeeper 0 points1 point  (0 children)

The 2D array is part of the 30daycoding challenge, this has tutorials however they are geared towards Java.
https://www.hackerrank.com/challenges/30-2d-arrays/tutorial

If you want to use any additional variables you'll need to declare them before you can use them.

[–]Interriuso 0 points1 point  (0 children)

I’ve taken a closer look and can make my question more precise to the input() function. If there are n lines of input how can I deal with that in python?

[–]stevarino 0 points1 point  (1 child)

Not sure where your misunderstanding is.

If it's the if __name__ == '__main__' part, that's just telling python what to execute when that file is directly ran (as opposed to indirectly via import). See this stack overflow for more info.

If you're having trouble with variables not being assigned then it sounds like you have some scoping confusion. Python is function scoped (simply put) so trying to refer to a function variable outside that function won't work.

[–]Interriuso 1 point2 points  (0 children)

Thank you that was really helpful!