Skip to content

Commit 0f884bd

Browse files
committed
Improve enums-exercise.py: enhance output messaging and formatting
- Add newline before possible laptops output for better readability - Add summary message showing count of available laptops - Display the operating system name using enum.value property - Improve user feedback with clearer output format
1 parent 67c5dff commit 0f884bd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

prep/enums-exercise.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ def create_person_from_input(laptops: List[Laptop]) -> None:
4949

5050
person = Person(name=name, age=age, preferred_operating_system=preferred_os)
5151
possible_laptops = find_possible_laptops(laptops, person)
52-
print(f"Possible laptops for {person.name}: {possible_laptops}")
53-
52+
53+
print(f"\nPossible laptops for {person.name}: {possible_laptops}")
54+
print(f"The library has {len(possible_laptops)} laptop(s) with {preferred_os.value}")
5455

5556
laptops = [
5657
Laptop(id=1, manufacturer="Dell", model="XPS", screen_size_in_inches=13, operating_system=OperatingSystem.ARCH),

0 commit comments

Comments
 (0)