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 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.

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