Skip to content

Commit 6cdc16c

Browse files
Fix formatting and clean up laptop allocation code
1 parent 2b38492 commit 6cdc16c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sprint-5/laptop_allocation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ def allocate_laptops(people: List[Person], laptops: List[Laptop]) -> Dict[Person
4444
return {
4545
people[i]: laptops[j] for i, j in zip(person_indices, laptop_indices)
4646
}
47+
4748
laptops = [
4849
Laptop(1, "Dell", "XPS 13", 13, OperatingSystem.ARCH),
4950
Laptop(2, "HP", "Spectre 15", 15, OperatingSystem.UBUNTU),
5051
Laptop(3, "Lenovo", "ThinkPad 14", 14, OperatingSystem.UBUNTU),
5152
Laptop(4, "Apple", "MacBook Air", 13, OperatingSystem.MACOS),
5253
Laptop(5, "Apple", "MacBook Pro", 16, OperatingSystem.MACOS),
5354
Laptop(6, "Dell", "Latitude", 15, OperatingSystem.ARCH),
54-
Laptop(7, "HP", "EliteBook", 13, OperatingSystem.MACOS), # Reviewer joke: HP running macOS 😄
55+
Laptop(7, "HP", "EliteBook", 13, OperatingSystem.MACOS),
5556
Laptop(8, "Lenovo", "Yoga", 14, OperatingSystem.UBUNTU)
5657
]
5758

@@ -69,6 +70,7 @@ def allocate_laptops(people: List[Person], laptops: List[Laptop]) -> Dict[Person
6970
assignment = allocate_laptops(people, laptops)
7071

7172
print("Laptop Assignments:\n")
73+
7274
for person, laptop in assignment.items():
7375
sadness = (
7476
person.preferred_operating_system.index(laptop.operating_system)

0 commit comments

Comments
 (0)