Adding a Value to a Dictionary : Introduction : Dictionary PYTHON TUTORIALS


PYTHON TUTORIALS » Dictionary » Introduction »

 

Adding a Value to a Dictionary


numbers = ('1','2','3','4','5','6','7','8','9','0')
letters = ('a','b','c','d','e','f')
punct = ('.''!''?')
charSetDict = {numbers:[], letters:[], punct:[]}
cSet = raw_input("Insert characters: ")
for c in cSet:
    for x in charSetDict.keys():
        if c in x:
            charSetDict[x].append(c)
            break;
charSetDict["Special"['%''$''#']
charSetDict["Special"'><'



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Dictionary
» Introduction