python - Is there a best way in my code to check for the values in my list? -
i have list of list, let's : list = [[34,50,0],[21,38,0],[48,69,0],[23,90,0],[12,21,0]]
what's best way following:
for in range(112): j in range(112): k in list: if k[0]=i , k[1]=j: # else: # else
it very vague asking, following list comprehension add true
list every time k[0]=i , k[1]=j
, otherwise false
.
values = [true if k[0] == , k[1] == j else false j in range(112) in range(112) k in list]
just in case wondering, there several
problems code want fix, though may pseudo-code:
- your indenting off
- your name
list
shadows built-in - you call
if k[0]=i , k[1]=j:
uses 1=
. shouldif k[0] == , k[1] == j:
Comments
Post a Comment