Count of Non-repeated Characters - Wipro

Count of Non-repeated Characters - Wipro

Problem:

The program must accept a string S as the input. The program must print the count of characters that are not repeated in the string S as the output. 

Input:

Abcdef#bcd

Output:

4

Program:

s = input().strip()

count = 0

for i in s: 

    if s.count(i) == 1:

        count += 1 

print(count)        

Comments

Popular posts from this blog

Pronic Integers in N - InfyTQ question

Count Strong Points - Accenture

Grouping Colorful LEDs - Accenture