Created
June 26, 2021 23:13
-
-
Save joan0fsnark/ad3d917dddd77c03e227edc850c41aaf to your computer and use it in GitHub Desktop.
Determines if a string has all unique characters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def unique_str(str): | |
unique = "" | |
for char in str: | |
if char not in unique: | |
unique += char | |
else: | |
continue | |
if unique == str: | |
print(True) | |
else: | |
print(False) | |
# unique_str("abcdef") | |
# unique_str("abcdddef") | |
# unique_str("0") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment