I am new to Python and I am trying to make a game that includes a 2D array as a board. I looked for how to declare a 2D array from StackOverflow previously but for some reason I get a NameError that cols is not defined. What am I am doing wrong?
class HelloWorld:
    rows = 5
    cols = 5
    arr = [[0 for i in range(cols)] for j in range(rows)]
Edit: This is the traceback:
Traceback (most recent call last):
  File "c:/Users/MyName/Documents/Python Scripts/HelloWorld.py", line 1, in <module>
    class HelloWorld:
  File "c:/Users/MyName/Documents/Python Scripts/HelloWorld.py", line 4, in HelloWorld
    arr = [[0 for i in range(cols)] for j in range(rows)]
  File "c:/Users/MyName/Documents/Python Scripts/HelloWorld.py", line 4, in <listcomp>
    arr = [[0 for i in range(cols)] for j in range(rows)]
NameError: name 'cols' is not defined
 
    