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

Python Python Basics (2015) Logic in Python Fully Functional

John Judge
John Judge
3,527 Points

Function 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")              
Chris Freeman
Chris Freeman
Treehouse Moderator 68,454 Points

How are you running theses functions? What commands are you using?

John Judge
John Judge
3,527 Points

Chris Freeman I'm just following along in the video, using the workspace like Ken is.

John Judge
John Judge
3,527 Points

From a blank console: python functions.py

John Judge
John Judge
3,527 Points

face palm emoji

Chris Freeman
Chris Freeman
Treehouse Moderator 68,454 Points

No worries. In the videos even Kenneth forgets to save sometimes!

Yikes! Can't believe I was stuck on this so long!

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,454 Points

Adding resolution. Be sure to save the file after making changes. Happens to the best of us.

Face palm indeed. Thanks for this question and answer! I was getting upset with myself.

Yes face palm indeed! Thanks guys