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 trial
gabriel davis
152 PointsCode from video just not working.
I checked and rechecked. My code is exaclty like the instructors.
Here is the code:
first_name = input("What is your first name? ")
print("Hello,", first_name)
if first_name == "Gabe":
print(first_name, "is learning python")
elif first_name == "Maxamilian":
print(first_name, "is learning with fellow students in the community! Me too!"
else:
print("You should totally learn python, {}!".format(first_name))
print("Have a great day {}!".format(first_name))
1 Answer
Steven Parker
243,228 PointsI may have spotted the issue even in the unformatted code:
It looks like the line that prints the message containing "Me too!" is missing the closing parenthesis at the end.
If that's not it, it will be easier to test once you have it formatted.
gabriel davis
152 PointsHi Steven,
Thank you! That worked perfectly. I will use proper formatting in the future! Thanks again!
Steven Parker
243,228 PointsYou might want edit this question to practice formatting and for the benefit of other students who read it later.
Steven Parker
243,228 PointsSteven Parker
243,228 PointsTry formatting your code so the spacing shows up (in Python, indentation is critical).
Use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area.
Or watch this video on code formatting.
Also, describe what your code is doing that is different from your expectations. And a like to the course page you are working with could be helpful, too.