Pack Your Bag explainer


I thought I was learning as I was going through this process as I was filling through lessons with no problems. Then I got to the last for steps and it proves I leaned nothing. Really had high hopes for this but feel like it won’t actually help me learn to code with repeating each phase over and over again


Maybe your codes has a bug, check it!


The secret message in the “sample code solution” made me laugh :laughing: as that was a very good answer - to test our knowledge - indeed.


Having a lot of trouble. The button for food is not .food but straight food.


Hey @SelTheDon,

Could you share a screenshot of your code? The extra property within the object shouldn’t block you from completing, so there may be another element that needs to be adjusted and I’d love to help you find it!

H :slight_smile:


Hey @David_Brake,

You might want to take a look at this comment of an example solution for this puzzle to see if you can spot where your code is different.

H :slight_smile:


I’ve read all these threads and I still can’t seem to get past this puzzle. Here is a screenshot of my code. Please help!


Your first line: var myBackpack = 'x'; can be eliminated. This is because you’re immediately overwriting this in your second line, where you declare the myBackpack variable again and assign it an object.

The string 'x' stored in myBackpack is never used in your code.



Thank you so much! I made it work!!!


Error as.

"Your packed your double check you have got the right food,print out the food properties value, using print(

Screen shots can’t be uploaded.
Shows only link of screen shot.


Perhaps you’re printing out a string that says, “” instead of the food property of the myBackpack object?

There shouldn’t be quote marks around the thing inside your print(). You’ll want to use the print() button, then the myBackpack button, then the .food button.



Hi Heather, could I please get your help? I am not sure if I am messing syntax or something else up


Each of your arrays [] only contains 1 string. For example, the array has 1 element: the string 'bananas,energy bar'. That is seen a a single item even though it contains a comma and space. Notice there is only one pair of quotes surrounding the string.

You can change that first string to 'bananas', and then on the blank below that add another string using the str key. That will add the orange quote marks so you can type in your second item in the array. You’ll have to do the same for your other 2 arrays as well.

If you need any more help with this puzzle, you can check out the explainer for Get More Supplies.


Get More Supplies explainer
Get More Supplies explainer

Hello @Grasshopper_Frankie

I don’t know why it doesn’t work. Can you help?



The only difference in your code is that you have curly brackets around the entire thing. This doesn’t affect how it will run, but it does affect the way we’re checking your code. We generally do this kind of check to make sure the solution isn’t tucked inside of an if statement or a loop.

Unfortunately, you can’t delete the brackets without deleting everything inside too. I would suggest, copying your solution to a new line below the big code block {} and then deleting the whole code block.



Don’t know what I’m doing wrong, I read all the answers


Whats the issue here then.


Similar to the post above, your print() statement is inside of an additional code block {}. If you delete that block and then re-add print(; it should work.



Your print statement is using the string '' instead of the food property of the myBackpack object. Notice how the string is orange and surrounded by quote marks.

If you tap on the string once and then tap the delete button (the back arrow with the X, right below the green play button in your picture), you can remove the string and then insert the myBackpack identifier, and then attach the .food member expression to it.



There is an error in Grasshopper! Just erase all your code and re-enter corrected code and all will be well.