Questions for a python project: I'm trying to write the part of a bingo game where I need the number called to cover the corresponding number on my "bingocard" I don't understand how to split the tuple of lists (numbers on card) and the tuple of lists containing (false) booleans, and get them assigned to individual variables so they can be "covered" I'll post the code for the functions I have, I need to write a new function called "cover" the other ones cannot be changed:
Why do you need to split your lists, they're mutable ( can be changed )? In Python, you could refer to any individual number on your "card" with an index like: card[ 0 ][ 1 ] The first index ( 0 ) is the tuple's index. The second ( 1 ) is the second element in that list. Indexing starts at 0. So checking a called number on a card would be iterating through the tuple, iterating through each list to see if that number is in it, and if is found, change the same indexes of the booleans to True.
Join our real-time social learning platform and learn together with your friends!