converting to a list, and back to a string is pointless as you can create a new string reversed
https://python-forum.io/Thread-Basic-Strings
EDIT:
just realized your rev the words as well. Here is how
>>> s = "Python Forum" >>> s[::-1] 'muroF nohtyP'
Quote:PS: if you would, please don't use a complex example like doing this whole task in one line, I really am a beginner.The [::-1] is splicing. in which is [START:STOP:STEP] where any field can be empty. start and stop is empty which means the whole string, -1 for step reversing the whole string. More info here under indexing and splicing
https://python-forum.io/Thread-Basic-Strings
EDIT:
just realized your rev the words as well. Here is how
s = 'Python Forum' rev_str = s[::-1] rev_words = rev_str.split()[::-1] print(' '.join(rev_words))
Recommended Tutorials: