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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Chaquayla Halmon](https://secure.gravatar.com/avatar/c9927cac91858c009df9ab8c8c4ac9ef?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Chaquayla Halmon
1,797 PointsFeedback if any
name = input("What's your name? ") print("{}, do you understand Python while loops?".format(name)) answer = input("Enter Yes/No: ")
while answer != 'Yes': if answer == 'No': print("Well, {}, while loops in Python repeat as long as a certain Boolean condition is met.".format(name)) answer = input("{}, now do you understand Python while loops?\nEnter Yes/No".format(name)) elif answer != 'Yes' or 'No': answer = input("Invalid answer. Try again...\nEnter Yes/No")
print("That's awesome, {}. I'm pleased that you understand while loops now. Let's move on.".format(name))
HEY: Just want to make sure it's readable. Thanks. -_-
1 Answer
![Robert Peters](https://uploads.teamtreehouse.com/production/profile-photos/6156182/micro_py-green.jpg)
Robert Peters
3,728 PointsSomewhere at the bottom of the page it says 'Markdown Cheatsheet' which shows you how to add code to the question like this:
name = input("What's your name? ")
print("{}, do you understand Python while loops?".format(name))
answer = input("Enter Yes/No: ")
while answer != 'Yes':
if answer == 'No':
print("Well, {}, while loops in Python repeat as long as a certain Boolean condition is met.".format(name))
answer = input("{}, now do you understand Python while loops?\nEnter Yes/No".format(name))
elif answer != 'Yes' or 'No':
answer = input("Invalid answer. Try again...\nEnter Yes/No")
print("That's awesome, {}. I'm pleased that you understand while loops now. Let's move on.".format(name))
Basically, you put 3 backticks and the language at the start, and 3 backticks at the end. Hope this helps!
P.s, you could maybe add something like:
while answer.upper() != 'YES':
so that it doesn't matter if they enter in lower or upper case? Apart from that I can't see any problems, but I'm a noob lol.
Jeff Muday
Treehouse Moderator 28,718 PointsJeff Muday
Treehouse Moderator 28,718 PointsI changed your comment to an answer and upvoted. Even though you say you're a noob, you answer like a Pro!
Keep up the good work Robert!