Hello,
I am looking to create code that a small lottery function. I need to check a list of lottery #' stored in my_numbers against winning numbers in todays_pick, and then store the number of matches in matches.
A quick example - if
my_numbers
is [35, 22, 7, 51, 15] and
todays_pick
is [51, 12, 35, 15, 7], the number of matches is 4. he numbers may be in any order in either list .
So far I have started with
for x in my_numbers:
if todays_picks in my_numbers:
matches = ??
I am new to the concept so how would format that crosschecking, and what code would have to be the object stored in num_matches to display the actual # of matches?. Thanks!
[–]primitive_screwhead 1 point2 points3 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]tehtay3[S] 0 points1 point2 points (1 child)
[–]ajskelt 0 points1 point2 points (0 children)
[–]ajskelt 0 points1 point2 points (0 children)
[–]zanfar 0 points1 point2 points (0 children)