Write a program to find the least Frequent Character in String


Topic: Write a program to find the least Frequent Character in String

Solution

test_str = "helloworld"
print ("The original string is : " + test_str) 
all_freq = {} 
for i in test_str: 
    if i in all_freq: 
        all_freq[i] += 1
    else: 
        all_freq[i] = 1
res = min(all_freq, key = all_freq.get)  
  
print ("The minimum of all characters in the given word is : " + str(res)) 



List all Python Programs