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 trialIAN WOOD
1,336 PointsPacking and Unpacking Dictionaries video: workspace code not working...?
I know enough to know I'm probably missing SOMETHING, but as far as I can tell this is identical to the code Ken is using in the video:
def packer(name=None, **kwargs):
print(kwargs)
def unpacker(first_name=None, last_name=None):
if first_name and last_name:
print("Hi {} {}!".format(first_name, last_name))
else:
print("Hi no name!")
packer(name="Kenneth", num=42, spanish_inquisition=None)
unpacker(**{"last_name": "Love", "first_name": "Kenneth"})
...but it doesn't run. No error, just:
treehouse:~/workspace$ python luggage.py treehouse:~/workspace$
(Yes the file is saved)
2 Answers
IAN WOOD
1,336 PointsGot it working - must've been a cache thing; when I reloaded the saved luggage.py to get the snapshot, it still had indents on lines 12 & 13 that weren't showing up in the window, even though the file didn't have the unsaved changes dot.
Chris Howell
Python Web Development Techdegree Graduate 49,610 PointsSweet, glad to see you got it working!
Chris Howell
Python Web Development Techdegree Graduate 49,610 PointsHi IAN WOOD
I copied your code into my own workspace and it works just fine. Could you possibly take a Snapshot of your workspace then share the link with me so I can have a look at your copy?
Chris Howell
Python Web Development Techdegree Graduate 49,610 PointsChris Howell
Python Web Development Techdegree Graduate 49,610 PointsFixed: code snippet to use Markdown.