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)
![cory woods](https://secure.gravatar.com/avatar/80b61e58e6f1eddb33c0936c94f45df3?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
cory woods
2,568 PointsHow do you know what is supposed to print?
how do I know what should print without a function or variable with assigned values?
2 Answers
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsAll the print statements in the quiz examples put out literal strings (like this one: print("A")
), so no variables or functions or needed.
You task is to anticipate how the program flow will be redirected by the "try" and "except" statements, and determine which of the print statements will run. From there, you can determine what the output will be since each statement that runs will output a single letter.
![rydavim](https://uploads.teamtreehouse.com/production/profile-photos/1857952/micro_scarabTattoo.jpg)
rydavim
18,814 PointsYou'll want to walk through the code step by step for each question. Try going one line at a time and thinking about what would happen when it runs. This method should work for both questions, but here is an example below.
print("A") # does this print?
try:
result = 5 + 5 # does this raise a ValueError or TypeError?
print("B") # depending on whether an error is raised, does this run?
except ValueError:
print("C") # did you trigger a ValueError?
except TypeError:
print("D") # did you trigger a TypeError?
else:
print("E") # if no errors were triggered, does this run?
print("F") # does this print?
Hopefully that gives you a place to start, but please let me know if you still have questions and we can walk through a solution. Happy coding!