# dict.get() 
  
# initializing string  
test_str = "GeeksforGeeks"
  
# using dict.get() to get count  
# of each element in string  
res = {} 
  
for keys in test_str: 
    res[keys] = res.get(keys, 0) + 1
  
# printing result  
print ("Count of all characters in GeeksforGeeks is : \n"
                                             +  str(res)) 

5beea4494762ad2e92cf40b0ce5b10e2537f8e25
<mask token>

<mask token>
for keys in test_str:
    res[keys] = res.get(keys, 0) + 1
print('Count of all characters in GeeksforGeeks is : \n' + str(res))

test_str = 'GeeksforGeeks'
res = {}
for keys in test_str:
    res[keys] = res.get(keys, 0) + 1
print('Count of all characters in GeeksforGeeks is : \n' + str(res))

# dict.get() 
  
# initializing string  
test_str = "GeeksforGeeks"
  
# using dict.get() to get count  
# of each element in string  
res = {} 
  
for keys in test_str: 
    res[keys] = res.get(keys, 0) + 1
  
# printing result  
print ("Count of all characters in GeeksforGeeks is : \n"
                                             +  str(res)) 
