Answer the question
In order to leave comments, you need to log in
Split json on commas?
This is the json
[{"id":"214115596"},{"id":"2476115554"},{"id":"544664596"},{"id":"215465596"},{"id":"21655596"},{"id":"2154665596"}]
def autor(chatid):
strid = str(chatid)
url2 = 'http://test.loc/apiv2.php?key=1'
response = requests.get(url2, headers={'User-Agent': 'my agent'})
for item in response.json()[0]['id']:
if item == strid:
return True
return False
Answer the question
In order to leave comments, you need to log in
When python is before primer...
jlist = [{"id":"214115596"},{"id":"2476115554"},{"id":"544664596"},{"id":"215465596"},{"id":"21655596"},{"id":"2154665596"}]
zapetaya=[]
for items in jlist:
value = int(items['id'])
zapetaya.append(value)
print (zapetaya)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question