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 trialJohn Judge
3,527 PointsFunction not working in console
When I get to the point where I'm running the function in the console it doesn't give an error, but it also doesn't run the function? I've started from scratch twice and have had no luck..?
def hows_the_parrot():
print("He's pining for the fjords")
hows_the_parrot()
def lumberjack(name):
if name.lower() == 'ken':
print("kenneth's a lumberjack and he's OK!")
else:
print("{} sleeps all night and {} works all day!".format(name, name))
lumberjack("john")
John Judge
3,527 PointsChris Freeman I'm just following along in the video, using the workspace like Ken is.
Chris Freeman
Treehouse Moderator 68,441 PointsCan you post what you've typed in the console?
John Judge
3,527 PointsFrom a blank console: python functions.py
Chris Freeman
Treehouse Moderator 68,441 PointsAnd you've saved the file, correct?
John Judge
3,527 Pointsface palm emoji
Chris Freeman
Treehouse Moderator 68,441 PointsNo worries. In the videos even Kenneth forgets to save sometimes!
William Owens
8,668 PointsYikes! Can't believe I was stuck on this so long!
2 Answers
Chris Freeman
Treehouse Moderator 68,441 PointsAdding resolution. Be sure to save the file after making changes. Happens to the best of us.
Tyler Amend
2,236 PointsFace palm indeed. Thanks for this question and answer! I was getting upset with myself.
Daron George
700 PointsYes face palm indeed! Thanks guys
Chris Freeman
Treehouse Moderator 68,441 PointsChris Freeman
Treehouse Moderator 68,441 PointsHow are you running theses functions? What commands are you using?