Python Forum
how to compare a list to a list of lists
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to compare a list to a list of lists
#2
I get very different messages.
Error:
File "./forum11.py", line 9 for i,j,k in wins_list: ^ IndentationError: unexpected indent
When I corrected this I get:
Error:
Traceback (most recent call last): File "./forum11.py", line 10, in <module> if i in player1_pieces and j in player1_pieces and k in player1_pieces: NameError: name 'player1_pieces' is not defined
When I corrected that I get:
Output:
no winner no winner no winner no winner no winner no winner no winner x wins
The message you get assumes you have defined a function. I see no function definition in your code.
Reply


Messages In This Thread
RE: how to compare a list to a list of lists - by ibreeden - Dec-22-2019, 11:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  No matter what I do I get back "List indices must be integers or slices, not list" Radical 4 1,185 Sep-24-2023, 05:03 AM
Last Post: deanhystad
  Delete strings from a list to create a new only number list Dvdscot 8 1,555 May-01-2023, 09:06 PM
Last Post: deanhystad
  List all possibilities of a nested-list by flattened lists sparkt 1 926 Feb-23-2023, 02:21 PM
Last Post: sparkt
  user input values into list of lists tauros73 3 1,077 Dec-29-2022, 05:54 PM
Last Post: deanhystad
  returning a List of Lists nafshar 3 1,079 Oct-28-2022, 06:28 PM
Last Post: deanhystad
  Сheck if an element from a list is in another list that contains a namedtuple elnk 8 1,856 Oct-26-2022, 04:03 PM
Last Post: deanhystad
  Creating list of lists, with objects from lists sgrinderud 7 1,665 Oct-01-2022, 07:15 PM
Last Post: Skaperen
Question Keyword to build list from list of objects? pfdjhfuys 3 1,579 Aug-06-2022, 11:39 PM
Last Post: Pedroski55
  Compare two lists (with intersections). wnesbv 0 992 Jul-06-2022, 09:07 AM
Last Post: wnesbv
  Split a number to list and list sum must be number sunny9495 5 2,308 Apr-28-2022, 09:32 AM
Last Post: Dexty

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020