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
Yuval Yarmus
1,020 PointsHow to end a condition statement
I want to make an action that takes place only if a conditional statement is true. After that, I want another independent action but I can't seem to make independent and end the condition. How can I do that?
2 Answers
kyle kitlinski
5,619 PointsIf I understand the question properly you simply unindent after the if
if True:
print('condition_true')
print('some_independant_function')
Yuval Yarmus
1,020 PointsI will try break thanks
Yuval Yarmus
1,020 PointsYuval Yarmus
1,020 PointsThat's what suppose to happen but from some reason in the treehouse workspace it doesn't let me remove the indentation from the second print so it stays in the if
kyle kitlinski
5,619 Pointskyle kitlinski
5,619 Pointshmm that is odd, I might suggest trying another browser... I havent used workspaces a ton but shift+tab is standard for un-indent, that may work instead of deletion. You could possibly try this:
but you may still run into indentation issues