Better naming for aux functions
This commit is contained in:
parent
0a7bc79f95
commit
209f8f4928
@ -63,7 +63,7 @@ with open("files/P16.txt") as f:
|
|||||||
Sues = [line for line in f.read().strip().split("\n")]
|
Sues = [line for line in f.read().strip().split("\n")]
|
||||||
|
|
||||||
|
|
||||||
def is_true_Sue(things):
|
def is_proper_Sue(things):
|
||||||
for thing in things:
|
for thing in things:
|
||||||
name, value = thing.split(": ")
|
name, value = thing.split(": ")
|
||||||
if ticker[name] != int(value):
|
if ticker[name] != int(value):
|
||||||
@ -76,7 +76,7 @@ def part1():
|
|||||||
aunt = Sue.split(":")[0]
|
aunt = Sue.split(":")[0]
|
||||||
things = Sue[len(aunt) + 2 :].split(", ")
|
things = Sue[len(aunt) + 2 :].split(", ")
|
||||||
|
|
||||||
if is_true_Sue(things):
|
if is_proper_Sue(things):
|
||||||
print(f"{aunt} gave me the gift")
|
print(f"{aunt} gave me the gift")
|
||||||
break
|
break
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ def part1():
|
|||||||
# What is the number of the real Aunt Sue?
|
# What is the number of the real Aunt Sue?
|
||||||
|
|
||||||
|
|
||||||
def is_real_real_Sue(things):
|
def is_really_proper_Sue(things):
|
||||||
for trait in things:
|
for trait in things:
|
||||||
name, value = trait.split(": ")
|
name, value = trait.split(": ")
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ def part2():
|
|||||||
aunt = Sue.split(":")[0]
|
aunt = Sue.split(":")[0]
|
||||||
things = Sue[len(aunt) + 2 :].split(", ")
|
things = Sue[len(aunt) + 2 :].split(", ")
|
||||||
|
|
||||||
if is_real_real_Sue(things):
|
if is_really_proper_Sue(things):
|
||||||
print(f"{aunt} gave me the gift")
|
print(f"{aunt} gave me the gift")
|
||||||
break
|
break
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user