Last active
March 29, 2022 15:32
-
-
Save Ra1d7/3640126bbe2baacb8ae2eaf62e391346 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
words = input('String to reverse: ').split(' ') | |
reverselist = [] | |
reversestring='' | |
numofwords = len(words)-1 | |
for x in range(0,numofwords): | |
reverselist.append(words[numofwords-x]) | |
reverselist.append(words[0]) | |
for item in reverselist: | |
reversestring += ' ' + item | |
print(reversestring) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment