Siem
Mam taki kod:
def cypher(string):
newList = string.split()
counter = 0
first = []
second = []
for word in newList:
newWord = word[::-1]
if counter % 2 == 0:
first.append(newWord)
counter += 1
else:
second.append(newWord)
counter += 1
final = first + second
return ' ' .join(final)
I on działa tak :
cypher('I want you to give me 5. I mean it!')
'I uoy evig .5 naem tnaw ot em I !ti'
Wie ktoś jak napisać program by przywrócić jako zdanie napisane przez cypher?