[Tutor] Help finishing a function
alan.gauld at yahoo.co.uk
Wed May 17 18:54:52 EDT 2017
Please use Reply-All or Reply-List when replying to the list,
otherwise it only goes to me.
On 17/05/17 17:21, Grace Sanford wrote:
> Syntactically speaking, how can I check if an element in the list
> "board" at position p equals "_" and then change that element to "0"?
You can use the == operator:
if board[index] == "_":
board[index] = "O"
# report an error? return false?
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:
More information about the Tutor