Python Forum
TypeError: string indices must be integers, not str
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: string indices must be integers, not str
#3
Your key variable is a string, so key["name"] is indeed trying to index a string with another string. Perhaps you want student["name"]. But it is not clear why you want to iterate on the keys...
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply


Messages In This Thread
RE: TypeError: string indices must be integers, not str - by Ofnuts - Jan-08-2017, 12:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  TypeError: string indices must be integers thecoziest 3 6,265 Sep-29-2019, 05:34 PM
Last Post: ichabod801
  please Help. TypeError: list indices must be integers, not str skamaaa01 1 4,408 Feb-04-2018, 12:33 PM
Last Post: Gribouillis
  create a 20 digit string, and cast to a list then add all the digits as integers nikhilkumar 2 6,400 Jul-19-2017, 04:53 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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