dimanche 6 janvier 2019

else: SyntaxError in for loop

I'm working on an assignment for an online course. I have a problem with the else: part of my code.

I'm pretty sure I indented it correctly and I did not forget the colon.

for tag in tags:
    pos = tag.find(">")
    if pos+3 == "<" :
      listo.append(int(tag([pos+1]+tag[pos+2]))
    else:
      listo.append(int(tag([pos+1]+tag[pos+2]+tag[pos+3])

Produces the following Error

else:
   ^ 
SyntaxError

Aucun commentaire:

Enregistrer un commentaire