Re: Do I need to convert string to integer in python?

2006-02-26 Thread Steven D'Aprano
On Sun, 26 Feb 2006 11:55:54 -0800, Allerdyce.John wrote: > Do I need to convert string to integer in python? or it will do it for > me (since dynamic type)? > > In my python script, I have this line: > x /= 10; > > when i run it, I get this error: > TypeError: un

Re: Do I need to convert string to integer in python?

2006-02-26 Thread Michael Amrhein
[EMAIL PROTECTED] schrieb: > Do I need to convert string to integer in python? or it will do it for > me (since dynamic type)? > > In my python script, I have this line: > x /= 10; > > when i run it, I get this error: > TypeError: unsupported operand type(s) fo

Re: Do I need to convert string to integer in python?

2006-02-26 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Do I need to convert string to integer in python? or it will do it for > me (since dynamic type)? > > In my python script, I have this line: > x /= 10; > > when i run it, I get this error: > TypeError: unsupported operand type(s) fo

Re: Do I need to convert string to integer in python?

2006-02-26 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Do I need to convert string to integer in python? or it will do it for > me (since dynamic type)? Nope, no such implicit conversion (thanks be!). Strings are strings and ints and ints and never the twain shall meet, except by explicit request;-). &g

Re: Do I need to convert string to integer in python?

2006-02-26 Thread Heiko Wundram
[EMAIL PROTECTED] wrote: > Do I need to convert string to integer in python? or it will do it for > me (since dynamic type)? Yes. Dynamic typing doesn't say anything about a string and a number being "equal," as they are (e.g.) in Perl, it just says that you don't have t

Do I need to convert string to integer in python?

2006-02-26 Thread Allerdyce . John
Do I need to convert string to integer in python? or it will do it for me (since dynamic type)? In my python script, I have this line: x /= 10; when i run it, I get this error: TypeError: unsupported operand type(s) for /=: 'unicode' and 'int' I want to divide x by 10 a