I have a requirement to get incremental counts. I am new to Python so please help me.
I have tried below:
Testword = 'foo boo' letters = 'abcdefghijklmnopqrstuvwxyz' for key in Testword: print key, Testword.count(key)
f 1 o 4 o 4 1 b 1 o 4 o 4
I would like to get incremented count output in the same input order like
f=1 o=1 o=2 b=1 o=3 o=4
Please help me.