IndentationError: expected an indented block
#While executing following code: import networkx as net import urllib import urllib.request from urllib.request import urlopen def read_lj_friends(g, name):
Getting Error in next line
response=urllib.urlopen('http://www.livejournal.com/misc/fdata.bml?user=valerois') for line in response.readlines(): if line.startswith('#'): continue parts=line.split() if len(parts)==0: continue if parts[0]=='<': g.add_edge(parts[1],name) else: g.add_edge(name,parts[1]) g=net.Graph() read_lj_friends(g,'valerois') len(g) net.draw(g)
Error: exec(compile(f.read(), filename, 'exec'), namespace) File "C:/Users/DELL/Documents/Python Scripts/sample/myscript.py", line 8 response=urllib.urlopen('http://www.livejournal.com/misc/fdata.bml?user=valerois') ^ IndentationError: expected an indented block
@amitmishramtech Which task it's affiliate with?
i just want to get graph of Live Journal users. by using user name: Valerois. I have written this code in Python. but getting above mentioned error.
@amitmishramtech Is that task is related to a Codecademy exercise?
Closed