Skip to content

Instantly share code, notes, and snippets.

@richardpascual
Created June 18, 2021 22:24
Show Gist options
  • Save richardpascual/0b871c597f99d2ef073826bdd6dbd698 to your computer and use it in GitHub Desktop.
Save richardpascual/0b871c597f99d2ef073826bdd6dbd698 to your computer and use it in GitHub Desktop.
#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))
@richardpascual
Copy link
Author

Search instances of inventory by id number, select the item type with the highest frequency compared to a second item count.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment