#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 = " ")
      

      Python language logoFind non repeating characters in a string

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.