Not directly as in C, but, for example, if you have s='3' and you want s used as an integer, you can say s=int(s) and it is an integer. Conversely, if you have a question about the type, you could also say type(s) which, depending, will return, 'str','int', etc.

Hope this helps a bit.

Robert

Dotan Cohen wrote:
2008/8/21 Robert Berman <[EMAIL PROTECTED]>:
  
Perhaps because preNumber is a character and not an integer?

    

Perhaps. In php the distinction was made by the fact that there were
no non-numerical characters in a string. I don't know enough Python to
know if this is the case. Can I declare a variable type in Python as
in C?

  
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to