Converting String to int

Ognjen Bezanov ognjen at
Sun May 14 22:23:52 CEST 2006

Hi all, Another problem, with the same error (error: "invalid literal for 


mynums = "423.523.674.324.342.122.943.421.762.158.830"

mynumArray = string.split(mynums,".")

x = 0
for nums in mynumArray:
   if nums.isalnum() == true:
	x = x + int(nums)
	print "Error, element contains some non-numeric characters"

/end code

This seemed like a simple thing, and I have done it before with no issues. 
have I missed something obvious? taking into account my previous hex 
question, I tried changing int(nums) to int(nums,10) but it still gives me 
the error

More information about the Python-list mailing list