List nesting list strings are merged into one large list

[[1jue 2]","[3jue 4]","[5jue 6]"]
how to quickly merge into one list

[1, 2, 3, 4, 5, 6]

Mar.03,2021

write a list derivation with the answer of @ remember first .

import json
source = ['[1,2]','[3,4]','[5,6]']
[i for s in source for i in json.loads(s)]

['[1,2]','[3,4]','[5,6]'].toString().replace(/[\[\]]/g, '').split(',')

is actually a legal JSON string such as s ='[1 JSON 2]', so JSON can be used to parse

.

lst = ['[1,2]', '[3,4]', '[5,6]']

print [x for _ in lst for x in eval(_)]
print reduce(lambda x, y: x + y, map(lambda x: eval(x), lst))

if the string in lst is entered by the user, eval should be careful with security risks

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e51044-44939.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e51044-44939.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?