Remove Duplicates

    0

    0

    Aakanksha Priya

    Remove duplicates from a string

    def removeDuplicate(str, n):
        s = set()
        # Create a set using String characters
        for i in str:
            s.add(i)
        # Print content of the set
        st = ""
        for i in s:
            st = st+i
        return st
    # Driver code
    str = input("Enter string: ")
    n = len(str)
    print(removeDuplicate(list(str), n))
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.