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

brian curran
brian curran
565 Points

The lumberjack isn't ok

I'm following along in the video, the code is, as far as i can see, exactly what Kenneth has typed in. Yet The only output i get is Kenneth sleeps all night and works all day. I've tried upper, lower case, changed the names around, with the same output line. Any ideas?? Or have I lost it?

def hows_the_parrot():
    print("he's pining for the fjords!")

hows_the_parrot()

def lumberjack(name):
    if name.lower == 'kenneth':
        print("Kenneth's a lumberjack and he's OK!")
    else:
        print("{} sleeps all night and {} works all day!".format(name, name))
lumberjack("kenneth")

2 Answers

Steven Parker
Steven Parker
229,732 Points

To invoke ("call") a method, you must place parentheses after the method name. Argument(s) may go inside the parentheses, but the parentheses must be there even if no arguments are being passed.

So you would write "name.lower()".

brian curran
brian curran
565 Points

Derp. I'm blind. I can't believe I missed that! Thanks!