Missing Banana


#1

So here is my code:

groceries = [
"banana"
"orange"
"apple"
]

Then it says "Oops, try again.It looks like "banana" is not in your list


#2

If you renamed the variable then the old one is still in memory (the interpreter keeps running) and that one might be missing a banana.
if that's the case, refresh the browser (restarts the interpreter) and perhaps the error will change to complaining about the list being missing since your code doesn't create that variable any more. (assuming the above is your full code or at least that you aren't creating a list with the correct name anywhere else)


#3

HI thanks for the help. I have tried refreshing the browser and the same error is occuring


#4

full code and link to exercise? Make sure that the code is intact in your post, use the </> button in the editor


#5

groceries = [
indent preformatted text by 4 spaces"banana"
indent preformatted text by 4 spaces"orange"
indent preformatted text by 4 spaces"apple"
]

https://www.codecademy.com/en/courses/python-beginner-en-IZ9Ra/2/1?curriculum_id=4f89dab3d788890003000096

I think this is what you want


#6

I can't run that, that's not valid code. I should just be able to copy it and make no modifications, and run it, and get the same effect. Otherwise I'll just end up fixing your issue without even being aware of it or something like that. Not to mention the extra effort


#7

You can inspect what is in your list by printing it:

print groceries

Strings written next to each other with nothing separating them get concatenated into a single string, thus 'bo' 'b' becomes 'bob'


#8

I'm having a similar issue. When I made the list it kept telling me I didn't include orange in my dictionary. After playing with the code for a bit I used a lowercase O in orange and got an error telling me to double check orange. Here is my code please tell me what I am doing wrong.

prices = {
"apples" : 2,
"peaches" : 3,
"orange" : 5.5,
"pineapples" : 6
}

I apologize I'm new to this and don't know how to post the code as it shows in the lesson.


#9

Thanks to anyone trying to help but I figured this out. Apparently they dont want you putting in your own fruit lol