Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMightyIronElf 15
1,946 PointsUnexpected Indent
I have the wishlist code typed out exactly how he wanted it, but when I go into the console to test it it tells me that I have an unexpected indent on line one. Can anybody tell me why?
books = [ "Automate the Boring Stuff with Python:Practical Programming for Total Beginners-Al Sweigart", "Python for Data Analysis", "Fluent Python:Clear,Concise,and Effective Programming-Luciano Ramalho", "Python for Kids:A Playful Introduction To Programming-Jason R. Briggs", "Hello Web App:Learn how to Build a Web App-Tracy Osborn", ] print("Suggested gift:{}".format(Books[-1])
It's supposed to be spaced out into a list but I can't get it to work. =)
1 Answer
Steven Parker
231,271 PointsLine 1 of any Python program should not be indented. If you have any spacing or tab(s) at the beginning of line 1, remove it.
MightyIronElf 15
1,946 PointsThank you both @stevenparker and @travisalstrand for the answers and tips=)
Steven Parker
231,271 PointsMightyIronElf 14 — Glad to help. You can mark a question solved by choosing a "best answer".
And happy coding!
Travis Alstrand
Treehouse Project ReviewerTravis Alstrand
Treehouse Project ReviewerHey MightyIronElf 14 ! 👋
I'd love to help but it's unfortunately really hard to tell without seeing your code. If you're working in a Workspace on Treehouse, please create a snapshot and provide the link here so I can open up a forked version of it. It's the camera icon at the top right.
If not, could you please copy/paste your code here? If you type three backticks before and after your code, it should keep the formatting 👍