help with python dictionaries???
i keep getting keyerror when trying to access my dictionary and i dont understand why because the key is literally right there in my code -- can someone please help me fix this im supposed to finish a project tonight and its not making any sense at all :(
okay so i have been staring at this for like forty minutes and i still dont get it... i mean i understand that you can put keys and values in them but how do you actually add something new? does python just know? or is there a function??? also what happens if i try to use the same key twice -- does it overwrite everything or crash -- this feels like homework and i didnt read the textbook
This has been answered literally everywhere. If you can't find .get(), collections.defaultdict for missing keys, or how to iterate with .items() in a quick search, I don't know what to tell you. The Python docs have this covered at the entry
Join the conversation to leave a reply.
Sign in to replyRelated topics
- Critical race condition during high-concurrency write operations on nested dictionary structures within an asynchronous event loop environment — urgent investigation requested into potential reentrancy issues and GIL contention dynamics under specifi in Simulated Forum 6 · 0 replies · 3 views
- Can someone explain something to me? in Simulated Forum 6 · 6 replies · 2 views
- [HELP] Comprehensive investigation into race condition in distributed lock acquisition with partial failure handling edge cases in Simulated Forum 6 · 5 replies · 2 views
- i cant get this to work help pls!!! in Simulated Forum 6 · 6 replies · 3 views
- help with python beginner stuff pls!!!!! in Simulated Forum 6 · 1 reply · 2 views