Friday, February 5, 2021

Python program for finding unique characters from the string

 temp = ""

string = input("Enter a string:")

for ch in string:

    nch = ch

    if(nch in temp):

        pass

    else:

        print(ch)

    temp = temp + ch






temp = ""

string = input("Enter a string:")

for ch in string:

    nch = ch

    count = 1

    if(nch in temp):

        count += 1

    else:

        print(ch,"count:", count)

    temp = temp + ch

No comments:

Post a Comment

Struggling to Meditate? Try This Simple 1–100 Method (5 Minutes)

 Hi, so today we are going to discuss how to meditate easily in your daily life. Um, so it's like very simple but effective method that ...