We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 275feb8 commit 5c49864Copy full SHA for 5c49864
1 file changed
prep-exercises/exercise_eleven.py
@@ -98,3 +98,20 @@ def laptops_counter(preferred_operating_system_input:str) ->int:
98
return f"There are {sum} laptops with {user_os} operating system"
99
100
print(laptops_counter(preferred_operating_system_input))
101
+
102
103
104
105
+def more_available_os(user_os: operatingSystem) ->int:
106
+ os_counter = {}
107
+ for laptop in laptops:
108
+ os_counter[laptop.operating_system] = os_counter.get(laptop.operating_system, 0) + 1
109
110
+ max_count = max(os_counts.values())
111
112
+ user_os_count = os_counts.get(user_os, 0)
113
114
+ if user_os_count < max_count:
115
+ print(f"If you’re open to using {user_os} operating system, you’ll have a better chance of getting a laptop.”")
116
117
0 commit comments