0
This is a one line code. What's it's mulitiline version?
Here is the one line [x for x, letter in enumerate(board) if letter == ' ' and x != 0] I need the multi line!
7 Answers
+ 5
Vishnu Ram , your posted code is incomlete, please also post what the variable "board" is looking like. Thanks!
+ 3
What is your try..? Expected? Can you try?.
0
I need the multi line code for this to understand it better.
0
It means:
for x, letter in enumerate(board) :
if letter == ' ' and x != 0 :
x
Vishnu Ram Just transformed as it is to multiline....
0
This is the Board
board = [' ' for x in range(10)]
0
for x, letter in enumerate(board) :
if letter == ' ' and x != 0 :
what is this x for? x
the last one
0
x is Your first 1 liner code result, that is added to destination list iterately.. You are not mentioned that in code so I left it as it...
Replace that with
destination_list.append(x)
If it is not clear, then add full code..