Python Python Basics Types and Branching If, Else and Elif

walter fernandez
walter fernandez
1,023 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
162,936 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
Pro Student 630 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
Pro Student 630 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
162,936 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