---
title: "Comment by Eddie Smith on \"Advent of Code day 4\" | Hashnode"
description: "Excellent work. I thought this problem demanded more legwork than other days. And those line breaks! (I used Vim, to remove single newlines and reduce doubles t"
url: "https://hashnode.com/posts/advent-of-code-day-4/5fcbb1f32e4db7780e483a06/comment/5fcc2132ef5f84019de79608"
---

[Discussion](https://hashnode.com/posts/advent-of-code-day-4/5fcbb1f32e4db7780e483a06)

Comment [Advent of Code day 4](https://hashnode.com/posts/advent-of-code-day-4/5fcbb1f32e4db7780e483a06)

[Eddie Smith](https://hashnode.com/@seriousdude)

[Dec 6, 2020](https://hashnode.com/posts/advent-of-code-day-4/5fcbb1f32e4db7780e483a06/comment/5fcc2132ef5f84019de79608)

Excellent work. I thought this problem demanded more legwork than other days. And those line breaks! (I used Vim, to remove single newlines and reduce doubles to a single).

For the "chain of ands" problem, I tried something like:

```
def check_validity(passport)
     keys=["byr:","iyr:","eyr:","hgt:","hcl:","ecl:","pid:"]
     for test in keys:
         if test in passport:
              pass
         else:
              return False
     return True
```
