how to check all my dictionary value?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By potatobanana

guy, how to check all my value in dict?
exmple dict slot:{slot1:null , slot2:null , slot3:null.....}
what i try to do is, if even one value is null i will get true, but if allnot nulli will get false

:bust_in_silhouette: Reply From: Help me please

For this you only need to use the for loop.

for i in slot:
	if i == null:
		print("one or more value is null")

Here by using for loop. Each element in this becomes value of i (here i is a variable) one by one. For the first time i becomes slot1 then slot2 and so on. If any of the element is null then it prints one or more value is null

if it doesn’t print anything then all of these are not null