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
Write a Python program for the following task:
Take a string entered by the user and check if it begins with the letter "a" or not. If it begins with "a", the user is prompted that it is the first name on the list. If it does not begin with "a", the user is prompted that the string does not begin with the letter "a".
Write a Python program to check that a given string is a palindrome or not.
Write a Python program to reverse a string.
Write a function to check the complexity of a password string. A strong password should contain at least 8 characters, including uppercase letters, lowercase letters and digits.