KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

Take a string and create a substring that contains all the unique characters from the list.

Python String Manipulation

3 Likes

Answer

string1 = input("Enter a string: ")
unique = ""

for ch in string1:
    if ch not in unique:
        unique = unique + ch

print("Substring with unique characters:", unique)

Output

Enter a string: programming
Substring with unique characters: progamin

Answered By

3 Likes


Related Questions