Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Challenge Solution

Jareth Vasquez
Jareth Vasquez
1,744 Points

i cant understand why this is breaking, please help

name = input("What's your name? ")

# TODO: Ask the user by name if they understand Python while loops
understanding = input("Hey {}, do you understand while loops?\n(Enter yes/no)   ".format(name)
# TODO: Write a while statement that checks if the user doesn't understand while loops
while understanding.lower() != 'yes':
# TODO: Since the user doesn't understand while loops, let's explain them.
    print("while loops let me say this over and over again untill you say yes.")                        
# TODO: Ask the user again, by name, if they understand while loops.
    understanding = input("do you get it now?   ")

# TODO: Outside the while loop, congratulate the user for understanding while loops
 print("great job {}, glad we got that handled")

it keeps kicking back a syntax error on the while line can someone please point this out? thanks in advance!

EDIT: thank you for the help, simple thing to miss really was ticking me of trying to figure it out.

Blue DiamondXD
Blue DiamondXD
5,369 Points

HELLO Jareth Vasquez is this line understanding = input("Hey {}, do you understand while loops?\n(Enter yes/no) ".format(name)

your missing a ending paremtesis since your are making is to ask for a name you did every thing very good you only closed the where the variable is it should be

understanding = input("Hey {}, do you understand while loops?\n(Enter yes/no) ".format(name)) ^

1 Answer

You are missing a closing parenthesis at the end of this line:

understanding = input("Hey {}, do you understand while loops?\n(Enter yes/no)   ".format(name))

and your final print statement needs to be outdented so it lines up with while