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

POV: Childhood Memories of Diwali & Gujarati New Year ❤️

  https://www.youtube.com/watch?v=QJKdeGmDXdI Hi. So, a very happy Diwali to everyone out there. And like tomorrow it's going to be a Gu...