Created
April 18, 2019 10:58
-
-
Save firemanxbr/cb5b058f27c916b4fb677e7a1819f9b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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