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 trialChristian Rachal
4,039 PointsHaving trouble with hows_the_parrot and workspace
Here's my code:
def hows_the_parrot(): print("He's pining for the Fjord!")
hows_the_parrot()
def lumberjack(): 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")
When I enter it, it gives me this message:
treehouse:~/workspace$ python functions.py
He's pining for the Fjord!
Traceback (most recent call last):
File "functions.py", line 12, in <module>
lumberjack("Kenneth")
TypeError: lumberjack() takes 0 positional arguments but 1 was given
8 Answers
Josh Bennett
15,258 PointsYou have
lumberjack("Kenneth")
Make the K lowercase and you're golden.
the .lower()
method is checking for a lower case argument. Just for fun, take out the .lower() and see if it works as is.
Josh Bennett
15,258 PointsAAAhhhh. Ok. look at line 1 the
def lumberjack():
Should be ...
def lumberjack(name):
you need to pass an arguement in the function.
Josh Bennett
15,258 PointsAlso, click markdown cheat sheet below and format your questions/responses using the formatting best practices. Makes everything easier to read and easier to diagnose.
Josh Bennett
15,258 PointsKeep this handy. And take the console foundations and markdown courses.
Markdown Cheatsheet Markdown is a short-hand syntax for easily converting text to HTML. Below are some popular examples of Markdown formatting. For more examples reference Markdown Basics for a more detailed overview.
Links This is an example link
Code Wrap your code with 3 backticks (```) on the line before and after. If you specify the language after the first set of backticks, that'll help us with syntax highlighting.
```html
<p>This is code!</p>
```
Quoting If you're replying to someone, you can copy portions of their text into your reply, and mark them as quotations by putting > at the start of each line.
> This line is quoted.
Italic Here’s a word that is emphasized
Bold Here’s a word that is bold
Images
Unordered List
- Candy
- Gum
- Peanuts
Ordered List
- Red
- Green
- Blue
Christian Rachal
4,039 PointsThanks for your help Josh. I changed "Kenneth" to "kenneth" and I am still getting the same error message.
"treehouse:~/workspace$ python functions.py
He's pining for the Fjord!
Traceback (most recent call last):
File "functions.py", line 12, in <module>
lumberjack("kenneth")
TypeError: lumberjack() takes 0 positional arguments but 1 was given "
Christian Rachal
4,039 PointsStill not fixed, I will repost in the correct format ASAP.
When I click the Markdown Cheatsheet link, it takes me here: https://teamtreehouse.com/community
Surely, that's not right? I don't see a cheat sheet in the forum anywhere even when using the search bar.
Christian Rachal
4,039 PointsI started a new workspace and made sure to save my file every time I made a change. My code works now. Not sure what the issue was before. Thanks Josh!
Josh Bennett
15,258 PointsOk that wasn't super helpful because the markdown in the markdown file just formated. ugh. Just take the markdown course.