> Hi all, Another problem, with the same error (error: "invalid literal for
> int()")
Having the actual code would be helpful...
> code:
>
> mynums = "423.523.674.324.342.122.943.421.762.158.830"
>
> mynumArray = string.split(mynums,".")
>
> x = 0
> for nums in mynumArray:
>if nums.isalnu
Am Sonntag 14 Mai 2006 22:23 schrieb Ognjen Bezanov:
> mynums = "423.523.674.324.342.122.943.421.762.158.830"
>
> mynumArray = string.split(mynums,".")
This is the old way of using string functions using the module string. You
should only write this as:
mynumArray = mynums.split(".")
(using the
Hi all, Another problem, with the same error (error: "invalid literal for
int()")
code:
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)
else:
print "Err