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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![David Garcia](https://uploads.teamtreehouse.com/production/profile-photos/9152182/micro_Screenshot_20200115-232051__01.jpg)
David Garcia
Python Development Techdegree Graduate 11,254 PointsI get the Error "Return the dictionary instead of printing it." I am returning the correct dictionary help.
# enter your code here
def splitsville(address):
addy = (address.replace(",", " ").split())
addy[0:4] = [" ".join(addy[0:4])]
my_keys = ("street","city", "state", "zip_code")
my_dict = dict(zip(my_keys, addy))
return my_dict
addy = splitsville("100 E Main St, Anywhereville, Oregon, 22222")
print(addy)
1 Answer
![Chris Freeman](https://uploads.teamtreehouse.com/production/profile-photos/1153532/micro_image.jpg)
Chris Freeman
Treehouse Moderator 68,425 PointsHey David Garcia, you are very close!
The print
warning is a bit of false error. The checker has a general check whether any print
statement exists. The error message incorrectly assumes the print is within the function. Quick fix is to the delete print
statement.
Another error is the overly complicated creation of addy
. The split can be completely in one step by splitting on β, β. The .replace
is unnecessary. The join
is also unnecessary.
The rest is spot on.
Post back if you need more help. Good luck!!!
David Garcia
Python Development Techdegree Graduate 11,254 PointsDavid Garcia
Python Development Techdegree Graduate 11,254 PointsChris Freeman thanks Ill try it out when I get home! Not sure if you know but when do you think the job postings will be updated? I'm trying to leave my current job and get into a a dev job...
Chris Freeman
Treehouse Moderator 68,425 PointsChris Freeman
Treehouse Moderator 68,425 PointsI am not connected to the jobs posts so I canβt help there. Perhaps you could ask in the community general question category. Or email them at jobs@teamtreehouse.com!