Codecademy-Exercise-Answers icon indicating copy to clipboard operation
Codecademy-Exercise-Answers copied to clipboard

IndentationError: expected an indented block

Open amitmishramtech opened this issue 9 years ago • 4 comments

#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 avatar Feb 19 '17 06:02 amitmishramtech

@amitmishramtech Which task it's affiliate with?

ummahusla avatar Feb 19 '17 13:02 ummahusla

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 avatar Feb 20 '17 04:02 amitmishramtech

@amitmishramtech Is that task is related to a Codecademy exercise?

ummahusla avatar Feb 20 '17 11:02 ummahusla

Closed

ummahusla avatar May 05 '17 11:05 ummahusla