Indentation Error

Hello, i am new to coding. I started doing the first project on “Python 3”, and i couldn’t code my initial of the name.The link to the project is right here: " "
I coded

#My name is Gustavo Carvalho
#I like icecream
     print("  GGG  ")
     print(" G   G ")
     print(" G     ")
     print(" GGGGG ")
     print(" G   G ")
     print(" G   G ")
     print(" GGG  ")

Meanwhile, appears a error on my code.
" File “”, line 3
print(" GGG ")
IndentationError: unexpected indent "
Any help? Thanks!

Please check the following FAQ for some guidance on formatting code for the forums and other information that helps anyone attempting to answer a query.

Indentation is Python is how code is grouped together and is a syntax requirement rather than a suggestion. Do you have some empty whitespace before that print function on line 3?

Something like the following would throw an error due to the indentation of the fourth line-

#My name is Gustavo Carvalho
#I like icecream
    print(" GGG “)

This is the problem, i think everything is fine

All those indents before your print statements would be a cause for errors, you’d want to bring them back to the left hand side. Perhaps I wasn’t clear enough but you can’t simply add indents to the code at random spots. It follows certain syntax and then requires an indent such as if statements and class definitions.


Thank you so much, it worked!

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.