Python Forum
General Programming Question with Dictionary
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
General Programming Question with Dictionary
#2
A dictionary is a set of key/value pairs. You have to tell the dictionary which key you are trying to update. Your program just shoves a new value at it.

But assuming cybc is your dictionary, then str(cybc) is just a big string of all the keys and values (and some punctuation) smushed together. So when you're handed a string, you can't tell what part of the dictionary it came from.

If the key has digits in it, do you want to change the key, or do you just want to change the values?
Reply


Messages In This Thread
RE: General Programming Question with Dictionary - by bowlofred - Jan-07-2022, 06:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python can - general question caslor 0 1,139 Jul-14-2022, 05:21 PM
Last Post: caslor
  a general question barryjo 5 1,557 Feb-01-2022, 10:12 PM
Last Post: Gribouillis
Big Grin General programming question (input string)[ jamie_01 2 1,640 Jan-08-2022, 12:59 AM
Last Post: BashBedlam
  Question about formula implementation in general format Alienspecimen 0 1,681 Mar-01-2021, 08:39 PM
Last Post: Alienspecimen
  General list size question to solve problem Milfredo 3 2,392 Sep-27-2020, 08:42 AM
Last Post: Milfredo
  New to programming, loop question tomyan 1 1,675 Sep-25-2020, 04:32 PM
Last Post: Larz60+
  General Listbox question. Milfredo 4 2,208 Sep-06-2020, 07:36 PM
Last Post: Milfredo
  Dictionary question DrZ 2 1,685 Jul-29-2020, 08:53 PM
Last Post: DrZ
  General question about serialization/deserialization in python local 1 1,871 Jan-28-2020, 04:35 AM
Last Post: Larz60+
  General Programming Question Qui_Ten 1 2,214 Jan-14-2019, 11:15 AM
Last Post: steve_shambles

Forum Jump:

User Panel Messages

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