In Python, though you can place code at the lowest indent level to have it run, it is best to put it in a function it is best to put it in a function. To do so, you follow this general outline:
This encapsulates your logic into a main
function and calls it when you run this script. Check This StackOverflow question This StackOverflow question for a great explanation of if __name__ == "__main__"
. Basically, it tells Python to only run this code when the script is run as the main task.
In Python, though you can place code at the lowest indent level to have it run, it is best to put it in a function. To do so, you follow this general outline:
This encapsulates your logic into a main
function and calls it when you run this script. Check This StackOverflow question for a great explanation of if __name__ == "__main__"
. Basically, it tells Python to only run this code when the script is run as the main task.
In Python, though you can place code at the lowest indent level to have it run, it is best to put it in a function. To do so, you follow this general outline:
This encapsulates your logic into a main
function and calls it when you run this script. Check This StackOverflow question for a great explanation of if __name__ == "__main__"
. Basically, it tells Python to only run this code when the script is run as the main task.
so to access an element you have to specify the row first (y) and then the column (x). As SuperBiasedMan said SuperBiasedMan said, you can do this easily just by using your getGrid
and setGrid
.
Joe Wallis has great advice on how to format your strings Joe Wallis has great advice on how to format your strings, so I will skip over covering that.
so to access an element you have to specify the row first (y) and then the column (x). As SuperBiasedMan said, you can do this easily just by using your getGrid
and setGrid
.
Joe Wallis has great advice on how to format your strings, so I will skip over covering that.
so to access an element you have to specify the row first (y) and then the column (x). As SuperBiasedMan said, you can do this easily just by using your getGrid
and setGrid
.
Joe Wallis has great advice on how to format your strings, so I will skip over covering that.
[0:[0, 1, 2],
1:[0, 1, 2],
2:[0, 1, 2]]
[0:[0:'a', 1:'b', 2:'c'],
1:[0:'d', 1:'e', 2:'f'],
2:[0:'g', 1:'h', 2:'i']]
[0:[0, 1, 2],
1:[0, 1, 2],
2:[0, 1, 2]]
[0:[0:'a', 1:'b', 2:'c'],
1:[0:'d', 1:'e', 2:'f'],
2:[0:'g', 1:'h', 2:'i']]