Untitled diff

Created Diff never expires
5 eliminaciones
Líneas
Total
Eliminado
Palabras
Total
Eliminado
Para continuar usando esta función, actualice a
Diffchecker logo
Diffchecker Pro
20 líneas
5 adiciones
Líneas
Total
Añadido
Palabras
Total
Añadido
Para continuar usando esta función, actualice a
Diffchecker logo
Diffchecker Pro
20 líneas
def check(types, value):
def check(types, value):
value = int(value)
value = int(value)
if types == "cats:" or types == "trees:":
if types in ("cats:", "trees:"):
return props[types] < value
return props[types] < value
elif types == "pomeranians:" or types == "goldfish:":
elif types in ("pomeranians:", "goldfish:"):
return props[types] > value
return props[types] > value
return props[types] == value
return props[types] == value


props = {}
props = {}
with open("inpt.txt") as g:
with open("inpt.txt") as g:
for line in g:
for line in g:
line = line.strip("\n").split(" ")
line = line.strip().split()
props[line[0]] = int(line[1])
props[line[0]] = int(line[1])




with open("input16.txt") as f:
with open("input16.txt") as f:
for line in f:
for line in f:
line = line.strip("\n").split(" ")
line = line.strip().split()
if (check(line[2], line[3].strip(",")) and check(line[4], line[5].strip(",")) and check(line[6], line[7])):
if all(check(line[i], line[i+1].strip(",")) for i in range(2,7,2)):
print line
print line