Code is taking a lot of time not being able to execute but no errors

import requests
import json
url=“http://api.icndb.com/jokes/1/”
for i,joke in json_data[‘value’]:
with open(‘chuck.csv’,‘w’,encoding=‘utf-8’) as f:
u=url+"{}/".format(i)
r=requests.get(u)
json_data=json.loads(r.content)
id_string=str(json_data[‘value’][‘id’])+’,’
joke_string=json_data[‘value’][‘joke’]+’\n’
f.write(“ID,JOKE\n”)
f.write(id_string)
f.write(joke_string)

Hey @devanshmarwaha27, your code seems incomplete, anyways here i am sending a file for reference,
Take its help only when needed,

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

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.