Mar-05-2020, 09:50 PM
(This post was last modified: Mar-05-2020, 09:50 PM by al_Czervik.)
Thanks again. I fixed the syntax and it works now. Ok. I see about the string formatting - getting a little ahead of myself. I'm a little confused as to why
print(menu_ask,"in the new menu =",menu_ask in new_menu)
produces soup in the new menu = True
howeverpaint_colors = "red, blud, green, black, orange, pink" print("Red in paint colors = ", red in paint_colors)where
red in paint_colors
throws a name error--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-35-2f9734434943> in <module>() 1 paint_colors = "red, blud, green, black, orange, pink" ----> 2 print("Red in paint colors = ", red in paint_colors) NameError: name 'red' is not definedThe instructor specifies that when using
red in paint_colors
, red needs to be a str 'red'