I think there was a slight error in your code for python.
I followed your logic and iteration, and the answer turned out to be 300.
I don't know if I made an error, but it does match with the answer I got using plain logic.
Here's my explenation for the problem.
First, let's find how many of each number there are.
500/3 = 166.66, so there are 166 integers.
500/4 = 125, so there are 125 integers.
500/5 = 100, so there are 100 integers.
Next, we must find the duplicates of numbers.
3*4 = 12
3*5 = 15
4*5 = 20
500/12 = 41.67, so there are 41 integers
500/15 = 33.33, so there are 33 itnegers.
500/20 = 25, so there are 25 integers.
LCM = 3*4*5 = 60.
500/60 = 8.33, so there are 8 integers.
166+125+100-41-33-25+8 = 300.
Let me summarize.
First, we find how many numbers are divisble by 3,4,5. However, there are duplicates, so we subtract those, before adding the LCM!
Thanks! :)