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

Python Python Basics Types and Branching If, Else and Elif

walter fernandez
walter fernandez
4,992 Points

hello, I need help about If statement

student_name = input("what is your name?") print('hi,', student_name) if student_name == "Walter": print("I hope that you can interact with you fellows")

what is wrong here? appears error.

Steven Parker
Steven Parker
231,248 Points

It's hard to tell what could be wrong without seeing how it's indented. Use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area. :arrow_heading_down:   Or watch this video on code formatting.

Gideon De Villiers
Gideon De Villiers
Courses Plus Student 632 Points

Hi Walter, what is the error that you're receiving? This works for me.

student_name = input("What is your name?  ")
print("hi", student_name)
if student_name == "Walter":
    print("I hope that you can interact with your fellows")
Gideon De Villiers
Gideon De Villiers
Courses Plus Student 632 Points

Also Steven, thanks for showing me how to add my code via the Markdown Cheatsheet. Is there a way to include the console's output?

Steven Parker
Steven Parker
231,248 Points

You can include the console output in the code section, or I often like to use the Markdown blockquote syntax for it (>).

1 Answer