Sunday, October 18, 2015

Check if a string contains unique characters

def isuniq(string1):
    uchars=set()
    for c in string1:
        if c  in uchars:
            return False
        else:
            uchars.add(c)
    return True
   
print isuniq('parag')