How to make list each character of list? like this:
li = ['A','B','C']
into:
li = [['A'],['B'],['C']]
See "list comprehension".
It is simply,
[[i] for i in i]
or more generally,
[f(x) for x in list_name]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.