Indentation Error | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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?

29th Jan 2019, 7:54 AM
Dingo
Dingo - avatar
9 Answers
+ 2
if re.match(pattern, "grstinray"): pass print("Match 4")
30th Jan 2019, 11:42 AM
Seniru
Seniru - avatar
+ 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")
29th Jan 2019, 8:05 AM
Seniru
Seniru - avatar
+ 2
Dingo can you post the updated code so I can see whats happened actually
29th Jan 2019, 1:35 PM
Seniru
Seniru - avatar
+ 2
Dingo just press the tab before pass
29th Jan 2019, 2:11 PM
Seniru
Seniru - avatar
+ 1
i add pass keyword under line 15... now the indentationError is on pass Seniru Pasan
29th Jan 2019, 8:11 AM
Dingo
Dingo - avatar
+ 1
Seniru Pasan Thank you! Thank you all for helping!
30th Jan 2019, 11:49 AM
Dingo
Dingo - avatar
0
woohoo! more indent lines... sooo... any tips on how to fix them?
29th Jan 2019, 7:59 AM
Dingo
Dingo - avatar
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?
29th Jan 2019, 11:01 PM
Dingo
Dingo - avatar