Skip to content

Instantly share code, notes, and snippets.

@firemanxbr
Created April 18, 2019 10:58
Show Gist options
  • Save firemanxbr/cb5b058f27c916b4fb677e7a1819f9b8 to your computer and use it in GitHub Desktop.
Save firemanxbr/cb5b058f27c916b4fb677e7a1819f9b8 to your computer and use it in GitHub Desktop.
def rev(value):
x = value.split(' ')
rev = []
phrase = ''
for y in x:
#print(y)
size = len(y)
#print(size)
for x in range(size):
rev.append(x)
for z in y:
#print(y)
#print(len(y))
rev[size-1] = z
size = size -1
#print(rev)
str1 = ''.join(rev)
rev = []
phrase = phrase + str1 + ' '
print(phrase)
#return result
value = 'I am a software engineer. But,, I am also an operations engi.neer.'
expected = 'I ma a erawtfos reenigne. tuB,, I ma osla na snoitarepo igne.reen.'
#res = rev(value)
#assert res == expected
if __name__ == "__main__":
rev(value=value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment