the results of the following code is: ['di', 'me', 'medesimo', 'meco', 'mi', 'vergogno'] di me me me mi ve
How can I change the second list: di me me me mi ve
into a list of this type: ['di', 'me', 'me', 'me', 'mi', 've']
Thank you in advance!
txt="Di me medesimo meco mi vergogno"
a=txt.lower().split()
print(a)
for x in a:
print (x[0:2])
I expect to be able to have a list from which I can code a way to know if there are two or more elements that are the same. I am looking for alliteration.