READ CHARACTERS IN USER INPUT WITH DICTIONARY

a = input("Enter Some Characters Here: ")
lol = {}
for j in a:
    t = lol.get(j)
    if t == None:
        lol.setdefault(j, 1)
    else:
        t += 1
        lol.__setitem__(j, t)
print(lol)

Comments

Popular posts from this blog

CALCULATING FACTORIALS IN PYTHON LANGUAGE

Automating Piano Tiles in Python Which is Damn easy!!!!!!!!