Did not understand how to proceed for solution

I did not understood exactly what I have to do and the format of the input & outpu. Do I need to scrap all the jokes from the api and store it in a list ? how this will work by providing a particular joke id we’ll get a corresponding joke to that id, please demonstrate this to me with an example of code

Hey @pasta, here is the solution code, have a look on it and try to understand it by yourself line by line.

In case of doubt feel free to ask doubts, but first try your best to understand it.

Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section. :blush:

#!/usr/bin/env python
# coding: utf-8

# In[7]:


import json
import requests
import pandas as pd
import os 

url="http://api.icndb.com/jokes/json?"# url


pr={
"value":""
}

r=requests.get(url,params=pr)

d=r.content

p=json.loads(d)

m=p["value"]

t=pd.read_csv("./Test/ID.csv").values # this is my device location where the testcases are saved, here you give your path where your testcases are downloaded

t=t.reshape(-1,)

a_jokes=[]
for i in range(len(m)):
#if id is matched with the id given in testcases
    if(m[i]['id'] in t):
        joke=m[i]['joke']
        a_jokes.append(joke)

df=pd.DataFrame({'ID':t, 'joke': a_jokes})
# this make a CSV file name abhishek.csv and saved the all data into it
df.to_csv("aashi.csv",index=False)


# In[ ]:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.