+ 1

Python: I'm trying to create an if statement that is contingent upon something existing in a dictionary.

sword = [] if ("") in sword: print ("there is an item in sword") gun = {} if ("") in gun: print ("there is an item in gun")

15th Feb 2018, 3:00 PM
Stef
Stef - avatar
2 Respostas
0
I should have seen that during the lessons....but I'm trying to write the if statement that activates if there is anything in the dictionary.
15th Feb 2018, 3:58 PM
Stef
Stef - avatar