Now the results of this xmlload suggest that there is only three users to parse however there is a 4th whos data would read

number of selections = 0
number of winners = 0
Strike rate = 0

for my purposes it is not necessary to pull in user stat's for those with no track record, how do i make the code either skip users with 0 selections or at least make it so that the division by zero error doesn't affect the ability of the code to run in a loop?

Thanks for the answer Ashwin, I adjusted the code to what I think you must of meant (replacing user_numberofwinners with user_numberofselections) however the code is still returning ZeroDivisionError: float division by zero I double checked that it was said calculation causing the error by commenting them out and printing number of selections and number of winners only: number of selections = 112.0 number of winners = 21.0 number of selections = 146.0 number of winners = 21.0 number of selections = 163.0 number of winners = 55.0 number of selections = 0.0 number of winners = 0.0
–
AEAJun 5 '13 at 2:51

Fixed my answer. Had to use a == instead of is for comparison with float
–
AchromeJun 5 '13 at 2:56

Many thanks Ashwin, I know its basic coding but every time I get a new answer like this it adds to my repertoire! :)
–
AEAJun 5 '13 at 3:01

anytime you are testing the equality of floating point numbers, you are probably making a mistake. floating point numbers don't behave like you might expect. What do you think is the result of this? True or False?: python -c "x = 111111111111111111111; print((x + 0.0) == x)"
–
stewJun 5 '13 at 3:13