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.
Mark Roudebush901 Points
A question about 2 of 2 in the Create a Function quiz
## QUESTION: why doesn't the "B" print? I understand that there was no ValueError so C didn't print and because there was a TypeError "D" printed which means the else ("E") did not. I'm not sure why "B" got skipped. print("A") try: result = "test" + 5 print("B") except ValueError: print("C") except TypeError: print("D") else: print("E") print("F")
The try block will exit out on the line where the TypeError occurs.
If an error is encountered, a try block code execution is stopped and transferred down to the relevant except block.
Let me know if this helps here