+ 1
How to use if/else statement in value that is attribute in dictionary of python??
Let, dict={"xyz" :"black", "yxz" :"white", "zxy" :"white"} Now how to print name(key) only white using if/else??
1 Respuesta
+ 2
is this your doubt?
for k,v in dict.items():
if k[0] == "z":
print(v)
o/p : white