Create Your Own


Create Your Own

It says that vegetables is not defined.

I'm expecting it to work, but I'm getting an error message that says name 'vegetables' is not defined.

How do I get this to work? What am I doing wrong?

vegetables = ['carrot','broccoli','asparagus','peas']

for vegetable in vegatables:
    if vegetable == 'carrot':
        print orange
        print green
    print 'I like vegetables!'


Check your spelling.

Should those be strings?


Thank you very much!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.