-1
A=["asd","jkl","qwe"]
[A[1:3],A[0:1]]

gives

[['jkl', 'qwe'], ['asd']]

I wish it just gave

['jkl', 'qwe', 'asd']

How do I accomplish this seemingly elusive task?

edit: the version of python I must work with does not allow for * symbol.

berala
  • 55
  • 5
  • `[A[1], A[2], A[0]]`?? If you mean something else, please clarify your question. – Thierry Lathuille Jun 15 '22 at 17:42
  • @Timur Unless they're starting with already nested lists (doesn't look like it), I'd say the appropriate original would be one that's about doing what they want without building a nested list in the first place. – Kelly Bundy Jun 15 '22 at 17:54

1 Answers1

1
A=["asd","jkl","qwe"]
A = [*A[1:3], *A[0:1]]
Yohann Boniface
  • 494
  • 3
  • 10