I have a set of strings and a nested list of strings nested inside the list.
list1 = ['abc','def',[['abc','def']],['abc','def']].
and I want to get output similar shown below:
[['fed','cba'], [['fed','cba']], 'fed', 'cba']
when i used traditional method using built-in reverse() method and [::-1] as well. as shown below:
list1 = ['abc', 'def', [['abc', 'def']], ['abc', 'def']]
[x[::-1] for x in list1][::-1]
# and got output as [['def', 'abc'], [['abc', 'def']], 'fed', 'cba']
provide me some explanations on this?
list1. But not recursively.