I am very new to programming in Python but I was wondering whether you could help me.
I have this code below:
>>> fruit = [[""for column in range(4)]for row in range(4)]
>>> fruit
[['', '', '', ''], ['', '', '', ''], ['', '', '', ''], ['', '', '', '']]
>>> fruit[0][0] = "strawberry"
>>> fruit[0][1] = "apple"
>>> fruit[0][3] = "banana"
>>> fruit
[['strawberry', 'apple', '', 'banana'], ['', '', '', ''], ['', '', '', ''], ['', '', '', '']]
What i want to do to test the code is be able to iterate through each item in the list and for it to let me know where there isn't an item in the list. So it starts at [0][0] finds strawberry (and returns nothing) so carries on then it finds apple at [0][1] (and returns nothing) then at [0][2] there is nothing there so.... can it return to me [0][2] = no item? Do I need to use some kind of if else statement?
I hope you can make sense of what I want to be able to achieve and appreciate any feedback.
Many Thanks,
Richie