Skip to content

Instantly share code, notes, and snippets.

@joan0fsnark
Created June 26, 2021 23:13
Show Gist options
  • Save joan0fsnark/ad3d917dddd77c03e227edc850c41aaf to your computer and use it in GitHub Desktop.
Save joan0fsnark/ad3d917dddd77c03e227edc850c41aaf to your computer and use it in GitHub Desktop.
Determines if a string has all unique 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