Skip to content

Instantly share code, notes, and snippets.

@naemazam
Created October 20, 2021 09:27
Show Gist options
  • Save naemazam/5989a3f0da5cbc05da52e393bfefd29a to your computer and use it in GitHub Desktop.
Save naemazam/5989a3f0da5cbc05da52e393bfefd29a to your computer and use it in GitHub Desktop.
Enter a non empty string. After removing duplicate characters, sort from small to large and output it as a new string.
user_input = input("Enter a string:")
new_string = sorted(set(user_input))
new_data = "".join(new_string)
print(new_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment