0
Indentation Error
https://code.sololearn.com/c29d52DSouTC/?ref=app I am keep getting indentation error on print line 15, why is that happening? And any future tip for handing this type of error?
9 Respuestas
+ 2
if re.match(pattern, "grstinray"):
pass
print("Match 4")
+ 2
Hi! Indentation error occurs because of poorly indented code. In this code you have to indent line 16 by a tab.
if re.match(pattern, "grstinray"):
print("Match 4")
If you dont want to insert any statements after the if statement, then use the pass keyword.
if re.match(pattern, "grstinray"):
pass #cause the block to be closed
print("Match 4")
+ 2
Dingo can you post the updated code so I can see whats happened actually
+ 2
Dingo just press the tab before pass
+ 1
i add pass keyword under line 15...
now the indentationError is on pass
Seniru Pasan
+ 1
Seniru Pasan Thank you!
Thank you all for helping!
0
woohoo! more indent lines...
sooo... any tips on how to fix them?
0
Seniru Pasan
Just to be sure I am on the same page.
if re.match(pattern, "grstinray"):
pass #Tab?
print("Match 4")
Is this what you mean?