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)
![Andrew Garman](https://secure.gravatar.com/avatar/aefcfc6685bb454af2636d8e619be5cc?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Andrew Garman
187 PointsAlternate responses to different names arent printing
first_name = input("What is your first name? ")
print("Hello,", first_name)
if first_name == "Craig":
print(first_name, "is learning Python")
elif first_name == "Maximiliane":
print (first_name, "is learning in the community! Me too!")
else:
age = int(input("how old are you? "))
if age <= 6:
print("wow you're {}! If you're confident with your reading already...".format(age))
print("You should totally learn Python, {}!".format(first_name))
print(first_name, "is learning python")
Mod Edit: Fixed code formatting. See comment for how to make your code fancy and readable in your posts.
![rydavim](https://uploads.teamtreehouse.com/production/profile-photos/1857952/micro_scarabTattoo.jpg)
rydavim
18,814 PointsYou can format your code in posts by using some special markdown.
```python
Your code here!
```
This is especially useful for Python, where some errors may be related to white-space.
![rydavim](https://uploads.teamtreehouse.com/production/profile-photos/1857952/micro_scarabTattoo.jpg)
rydavim
18,814 PointsYour code appears to be working as expected for me. Can you elaborate on the issues you're having?
2 Answers
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsBecause it is not indented, that last "print" will be done in all cases. It looks like it was only intended for the "else" case, and for that it needs to be indented.
If that's not your issue, please describe it in a bit more detail.
![Ryan Markey](https://uploads.teamtreehouse.com/production/profile-photos/10608177/micro_me.jpg)
Ryan Markey
Front End Web Development Techdegree Student 12,565 Pointsfirst_name = input("What is your first name? ")
print("Hello,", first_name)
if first_name == "Craig":
print(first_name, "is learning Python")
elif first_name == "Maximiliane":
print (first_name, "is learning in the community! Me too!")
else:
age = int(input("how old are you? "))
if age <= 6:
print("wow you're {}! If you're confident with your reading already...".format(age))
print("You should totally learn Python, {}!".format(first_name))
print(first_name, "is learning python")
I'm not entirely sure what your intention is with your code... but it works perfectly! You must remember to indent your code properly or python won't be able to understand, with the last three 'print' functions they all need to be indented with the same spacing beneath the 'if' statement for these actions to be executed when the code runs.
KRIS NIKOLAISEN
54,969 PointsKRIS NIKOLAISEN
54,969 PointsDid you save your work first? Can you format your code using markdown?