Here I am trying to change a string using the following logic,
st = "This is Ok"
rst = list(st)
rst.reverse()
''.join(s for s in rst)
It works fine, but when I try to follow the logic below, I get an error message,
st = "This is Ok"
''.join(s for s in list(st).reverse())
Here is the mistake
----> 1 ''.join(s for s in list(st).reverse())
TypeError: 'NoneType' object is not iterable
Please explain the above process.
source
share