>> nums = [ch for ch in aString if ch in string.digits]
> I'd spell that
>
> nums = [ch for ch in aString if ch.isdigit()]
Now I had a look for a digit() method but never notoced
the isdigit() one.
Thanks Brian.
Alan G.
___
Tutor maillist - Tutor@
Alan Gauld said unto the world upon 05/01/06 04:16 PM:
>>Here is how it should work:
>>val(7) = 7
>>val(bbab7) = 7
>>val(aa7aa) = 7
>>val( 7) = 7
>
>
> There is no direct equivalent for val() as shpwn above the
> nearest is int() or float() but that will only work with the first
> and last e
Thank you both
I think I'll manage to continue with my program :)
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> Here is how it should work:
> val(7) = 7
> val(bbab7) = 7
> val(aa7aa) = 7
> val( 7) = 7
There is no direct equivalent for val() as shpwn above the
nearest is int() or float() but that will only work with the first
and last examples. (It is a pretty arbitrary functionn to convert
aa7aa to
At 12:40 PM 1/5/2006, Boyan R. wrote:
>I need program to convert my string in integer.
>I remember in BASIC I used val(string) command
>Is there a Python equivalent ?
>
>Here is how it should work:
>val(7) = 7
>val(bbab7) = 7
>val(aa7aa) = 7
>val( 7) = 7
>
>This last is most important, currently
On Thu, 5 Jan 2006, Boyan R. wrote:
> I need program to convert my string in integer.
> I remember in BASIC I used val(string) command
> Is there a Python equivalent ?
>
> Here is how it should work:
> val(7) = 7
> val(bbab7) = 7
> val(aa7aa) = 7
> val( 7) = 7
Hi Boyan,
Python has a functi
I need program to convert my string in integer.
I remember in BASIC I used val(string) command
Is there a Python equivalent ?
Here is how it should work:
val(7) = 7
val(bbab7) = 7
val(aa7aa) = 7
val( 7) = 7
This last is most important, currently I don't know how to
convert string " 7" to