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 trialHarsh Kumar Woike
204 Pointsproblem
name = input("what is your name? ")
if name == "harsh": print(name + " is a lumberjack") else: print(name + " is also a lumberjack")
the above written code is not compiling. it is showing syntax error in "else" line 5
1 Answer
Guillaume Maka
Courses Plus Student 10,224 PointsTry
name = input("what is your name? ")
if name == "harsh":
print(name + " is a lumberjack")
else:
print(name + " is also a lumberjack")
Harsh Kumar Woike
204 PointsHarsh Kumar Woike
204 Pointsi did exactly that. when i posted my question the codes came in the same lines. but in the workspace i did exactly what you have suggested. this is the snapshot of my code. please have a look. https://w.trhou.se/44jrs731sw
Guillaume Maka
Courses Plus Student 10,224 PointsGuillaume Maka
Courses Plus Student 10,224 PointsThe first print in the if statement is not correctly indented