Answer the question
In order to leave comments, you need to log in
How to parse values into python from such a server response?
Hello, help me parse the name value from such a server response, I just can’t figure it out. Tried json, nothing comes out.
The example of the server response itself:
[{'name': 'Vasya', 'age': '25'}]
And output in print the result the name that will be in the response of the server
Vasya
Answer the question
In order to leave comments, you need to log in
Your dictionary is in the list. Get a dictionary from the list and then refer
obj = [{'name': 'Vasya', 'age': '25'}]
obj_dict = obj[0]
print(obj_dict['name'])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question