Skip to content

Commit 60782dd

Browse files
committed
input user message when there are more than a laptop of their chosen OS
1 parent 6cf094f commit 60782dd

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

prep-exercises/exercise_eleven.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ class Laptop:
4848
Laptop(id=3, manufacturer="Apple", model="MacBook Air", screen_size_in_inches=15, operating_system=operatingSystem.MACOS),
4949
Laptop(id=4, manufacturer="Lenovo", model="ThinkPad X220", screen_size_in_inches=12.5, operating_system=operatingSystem.LINUX),
5050
Laptop(id=5, manufacturer="Dell", model="XPS", screen_size_in_inches=13.7, operating_system=operatingSystem.ARCH),
51-
Laptop(id=6, manufacturer="Dell", model="XPS", screen_size_in_inches=15.5, operating_system=operatingSystem.UBUNTU),
52-
Laptop(id=7, manufacturer="Dell", model="XPS", screen_size_in_inches=15, operating_system=operatingSystem.UBUNTU),
53-
Laptop(id=8, manufacturer="Apple", model="MacBook", screen_size_in_inches=13.3, operating_system=operatingSystem.MACOS),
51+
Laptop(id=6, manufacturer="Dell", model="XPS", screen_size_in_inches=10.4, operating_system=operatingSystem.ARCH),
52+
Laptop(id=7, manufacturer="Dell", model="XPS", screen_size_in_inches=15.5, operating_system=operatingSystem.UBUNTU),
53+
Laptop(id=8, manufacturer="Dell", model="XPS", screen_size_in_inches=15, operating_system=operatingSystem.UBUNTU),
54+
Laptop(id=9, manufacturer="Apple", model="MacBook", screen_size_in_inches=13.3, operating_system=operatingSystem.MACOS),
5455
]
5556

5657

@@ -94,6 +95,6 @@ def laptops_counter(preferred_operating_system_input:str) ->int:
9495
if sum == 1:
9596
return f"There is {sum} laptop with {user_os} operating system"
9697
elif sum > 1:
97-
return f"There are {sum} laptops with {user_os} operating system"
98+
return f"There are {sum} laptops with {user_os} operating system.\nIf you're happy with {user_os}, you’ll have a better chance of getting a laptop."
9899

99100
print(laptops_counter(preferred_operating_system_input))

0 commit comments

Comments
 (0)