Find non repeating characters in a string

    0

    0

    CrypticSai-08

    #take user input
    String = "prepinsta"
    for i in String:
        #initialize a count variable
        count = 0
        for j in String:
            #check for repeated characters
            if i == j:
                count+=1
            #if character is found more than 1 time
            #brerak the loop
            if count > 1:
                break
        #print for nonrepeating characters
        if count == 1:
            print(i,end = " ")
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.