program to print all the unique characters in a given sentence
Answers
Answered by
1
Code: [in Python language]
Explanation:
We retrieve the sentence using the function and store it into a variable 's'. A list is created to store the unique characters in the sentence. A loop is initiated to traverse through the characters in the sentence, which also checks if it's unique or not through a conditional statement that checks if its count/occurrence is equal to 1, using the method. If it is, it gets added to the list earlier created for the same and the characters are later on printed.
Similar questions