def print_duplicate_characters(string):
duplicates = []
for char in string:
if string.count(char) > 1 and char not in duplicates:
duplicates.append(char)
return duplicates
# Example usage:
text = input("Enter a string: ")
duplicate_chars = print_duplicate_characters(text)
if duplicate_chars:
print(f"The duplicate characters in the string are: {duplicate_chars}")
else:
print("No duplicate characters found in the string.")
To embed this project on your website, copy the following code and paste it into your website's HTML: