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 trialMax Teter
Courses Plus Student 1,046 PointsIm quite confused as to what Im doing wrong here
Im trying to write this lumberjack function as i follow along the video but it wont call properly and I cant seem to understand my syntax error def hows_the_parrot(): print("He's pining for the fjords!")
hows_the_parrot()
def lumberjack(name, pronoun): print("{}'s lumberjack and {} ok!".fromat(name, pronoun))
lumberjack("Max", "He's") lumberjack("Lacey", "She's") lumberjack("Sam", "They're")
I get this error message in response
treehouse:~/workspace$ python Functions.py
He's pining for the fjords!
Traceback (most recent call last):
File "Functions.py", line 9, in <module>
lumberjack("Max", "He's")
File "Functions.py", line 7, in lumberjack
print("{}'s lumberjack and {} ok!".fromat(name, pronoun))
AttributeError: 'str' object has no attribute 'fromat'
1 Answer
Ryan S
27,276 PointsHi Max,
If you take a look at the very last line of your error:
AttributeError: 'str' object has no attribute 'fromat'
Notice that you have a small typo in what should be "format". You can then use this error stack trace to see where this typo occurs in your code:
...
File "Functions.py", line 7, in lumberjack
print("{}'s lumberjack and {} ok!".fromat(name, pronoun))
AttributeError: 'str' object has no attribute 'fromat'
So the typo is on Line 7 of Functions.py.
Hope this helps.
Max Teter
Courses Plus Student 1,046 PointsMax Teter
Courses Plus Student 1,046 PointsMy god I cant believe i overlooked that thank you so much hahaha