Python Forum
No matter what I do I get back "List indices must be integers or slices, not list"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No matter what I do I get back "List indices must be integers or slices, not list"
#3
It returns what I expected. "y" is a list with 6 strings inside. I figured that it would loop through the items in "y" the same way it looped through the different lists in "grid".

UPDATE: Wait..... you're right. Okay I got my code to work. The solution was:
for y in grid:
    for x in y:
        print(x, end = '')
    print('')
Thank you :3
Reply


Messages In This Thread
RE: No matter what I do I get back "List indices must be integers or slices, not list" - by Radical - Sep-23-2023, 06:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Strange behavior list of list mmhmjanssen 3 455 May-09-2024, 11:32 AM
Last Post: mmhmjanssen
  tuple indices must be integers or slices, not str cybertooth 16 12,201 Nov-02-2023, 01:20 PM
Last Post: brewer32
  boto3 - Error - TypeError: string indices must be integers kpatil 7 1,467 Jun-09-2023, 06:56 PM
Last Post: kpatil
  Why do I have to repeat items in list slices in order to make this work? Pythonica 7 1,473 May-22-2023, 10:39 PM
Last Post: ICanIBB
  Delete strings from a list to create a new only number list Dvdscot 8 1,728 May-01-2023, 09:06 PM
Last Post: deanhystad
  Response.json list indices must be integers or slices, not str [SOLVED] AlphaInc 4 6,724 Mar-24-2023, 08:34 AM
Last Post: fullytotal
Question How to append integers from file to list? Milan 8 1,595 Mar-11-2023, 10:59 PM
Last Post: DeaD_EyE
  List all possibilities of a nested-list by flattened lists sparkt 1 1,000 Feb-23-2023, 02:21 PM
Last Post: sparkt
  "TypeError: string indices must be integers, not 'str'" while not using any indices bul1t 2 2,195 Feb-11-2023, 07:03 PM
Last Post: deanhystad
  Error "list indices must be integers or slices, not str" dee 2 1,590 Dec-30-2022, 05:38 PM
Last Post: dee

Forum Jump:

User Panel Messages

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