Grab repeated Strings from any given sentences
Code:For extracting repeated string occurrences
def Occurrences(string):
word="Microsoft"
letters={words for words in string if words in word.lower()}
print(f"{''.join(letters).upper()}\n Repeated letters: {len(letters)}")
Occurrences(input("Enter the letters "))
Comments
Post a Comment