Created
June 18, 2021 22:24
-
-
Save richardpascual/0b871c597f99d2ef073826bdd6dbd698 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Write your function here | |
def more_frequent_item(lst, item1, item2): | |
if lst.count(item1) >= lst.count(item2): | |
return item1 | |
else: | |
return item2 | |
#Uncomment the line below when your function is done | |
print(more_frequent_item([2, 3, 3, 2, 3, 2, 3, 2, 3], 2, 3)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Search instances of inventory by id number, select the item type with the highest frequency compared to a second item count.