‘function’ object has no attribute ‘loads’
import json
def json(url):
json_response=urlopen(url)
json_=json_response.read()
json_data=json.loads(json_)
print(type(json_data))
with open(“chuck_norris.csv”,“w”) as f:
if json_data[‘value’][‘jokes’]!=None:
z=(json_data[‘value’][‘joke’])
z+=’\n’
f.write(z)