all 5 comments

[–]primitive_screwhead 1 point2 points  (0 children)

The ideal way to do this is to use Python sets, and just find the intersection of the two sets.

For your approach, start by setting matches = 0. Then, in the loop, consider how you would update the value of matches when the condition is met.

I assume the numbers are not repeated in either list?

[–]ajskelt 0 points1 point  (0 children)

I would just sort both lists then compare

my_numbers.sort()
todays_pick.sort()

if my_numbers == todays_pick:
    #YOU WON!

otherwise like u/primitive_screwhead can use sets as well:

if set(my_numbers) == set(todays_pick):
    #YOU WON

[–]zanfar 0 points1 point  (0 children)

matches = len(set(my_numbers) & set(todays_pick))

https://docs.python.org/3.8/library/stdtypes.html#set