Skip to content

Commit e9ba778

Browse files
committed
refactoring prefOpratingSys.py file
1 parent 172f9c6 commit e9ba778

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎sprint5-prep-exercises/prefOperatingSys.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Laptop:
2020
def find_possible_laptops(laptops: List[Laptop], person: Person) -> List[Laptop]:
2121
possible_laptops = []
2222
for laptop in laptops:
23-
if laptop.operating_system == person.preferred_operating_systems:
23+
if laptop.operating_system in person.preferred_operating_systems:
2424
possible_laptops.append(laptop)
2525
return possible_laptops
2626

@@ -41,8 +41,6 @@ def find_possible_laptops(laptops: List[Laptop], person: Person) -> List[Laptop]
4141
possible_laptops = find_possible_laptops(laptops, person)
4242
print(f"Possible laptops for {person.name}: {possible_laptops}")
4343

44-
45-
4644
# Yes, at first, when I changed str to list[str],
4745
# mypy showed errors as I expected because I was still passing strings instead of lists
4846
# Then I changed the field name to the plural form `preferred_operating_systems` to match the fact that it is now a list.

0 commit comments

Comments
 (0)