Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: curious syntax with dictionary item
Post: RE: curious syntax with dictionary item

I hear your words. I appreciate your time. I understand that the comma at the end makes the difference. So the dictionary contains a tuple... where one part of the tuple is None?
inselbuch General Coding Help 3 2,783 Mar-09-2019, 04:16 PM
    Thread: curious syntax with dictionary item
Post: curious syntax with dictionary item

d = {} a = "hello" d['x'] = a, print(d)Here's the result: {'x': ('hello',)} Python created the item as a two-element list maybe? Consider: >>> print(d["x"][0]) helloDo you wonder what ele...
inselbuch General Coding Help 3 2,783 Mar-09-2019, 03:57 PM

User Panel Messages

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