-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi sharon,
as I understand, you want to remove certain characters of a string. Try:
number = int(fetched_num ber.replace(',' , ''))
this will first remove any , characters and then convert the string
into an integer.
Best,
Manuel
On Aug 25, 2008, at 4:15 PM, sharon k wrote:
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
iD8DBQFIssKJcZ7 0OCIgLecRAkxTAJ 4wWKxmlAS8hdQZK 0Eoj7pAxwx41wCa A/eI
NY9GZKX6+PNIYIG aaghNvZg=
=JN2/
-----END PGP SIGNATURE-----
Hash: SHA1
Hi sharon,
as I understand, you want to remove certain characters of a string. Try:
number = int(fetched_num ber.replace(',' , ''))
this will first remove any , characters and then convert the string
into an integer.
Best,
Manuel
On Aug 25, 2008, at 4:15 PM, sharon k wrote:
hi all,
>
i am new to python.
>
i fetch a webpage with urllib, extract a few numbers in a format as
follow;
>
10,884
24,068
>
my question is how to remove the comma between the number, since i
have to add them up later.
>
sorry for my bad english.
--
http://mail.python.org/mailman/listinfo/python-list
>
i am new to python.
>
i fetch a webpage with urllib, extract a few numbers in a format as
follow;
>
10,884
24,068
>
my question is how to remove the comma between the number, since i
have to add them up later.
>
sorry for my bad english.
--
http://mail.python.org/mailman/listinfo/python-list
Version: GnuPG v1.4.7 (Darwin)
iD8DBQFIssKJcZ7 0OCIgLecRAkxTAJ 4wWKxmlAS8hdQZK 0Eoj7pAxwx41wCa A/eI
NY9GZKX6+PNIYIG aaghNvZg=
=JN2/
-----END PGP SIGNATURE-----