I have this sentence: 'Johnny Johnny yes papa'. And I want to put the first element of this sentence (as a list) again at the end. This is my code:
sentence = 'Johnny Johnny yes papa'
if len(sentence)>0:
sentence = sentence.split()
sentence = sentence.extend(sentence[0])
But it returns me a none object. I tried this:
if len(sentence)>0:
sentence = sentence.split()
#sentence = sentence.extend(sentence[0])
sentence = sentence.append(sentence[0])
And again, it returns none. Please, could you help me with this error? The intended list is: ['Johnny','Johnny','yes','papa','Johnny']