D
D
Denis Petrenko2021-06-12 19:13:58
Python
Denis Petrenko, 2021-06-12 19:13:58

How to turn a list into a string?

Network string of the form: ["param", "param", "mem"].
How can I turn this string into an equivalent list?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
soremix, 2021-06-12
@Termoslik

from ast import literal_eval

a = '["парам", "парам", "пам"]'
b = literal_eval(a)

R
Ramis, 2021-06-12
@ramzis

import json
list = json.loads('["парам", "парам", "пам"]')
print(list[0])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question