Skip to content

Instantly share code, notes, and snippets.

@Ra1d7
Last active March 29, 2022 15:32
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