On 10/9/06, Christoph Haas <[EMAIL PROTECTED]> wrote:
> Yes, I know Perl makes "0" from anything that doesn't look like a number
> but Python's principle is to never hide errors while Perl makes certain
> assumptions. So Python prefers to complain.
And raises real exceptions moreover, instead of
[EMAIL PROTECTED] wrote:
> The perl version of this code works but not the python version. What am
> I doing wrong?
>
> message = "abc"
> password = "z12"
>
> scrambled = message ^ password
>
The error message (which you should have supplied) tells you why it
fails. That operator does not operat
On Sunday 08 October 2006 14:09, [EMAIL PROTECTED] wrote:
> The perl version of this code works but not the python version. What am
> I doing wrong?
>
> message = "abc"
> password = "z12"
>
> scrambled = message ^ password
"abc" XOR "z12"? Strings don't have an __xor__ method.
> I also wondered w
The perl version of this code works but not the python version. What am
I doing wrong?
message = "abc"
password = "z12"
scrambled = message ^ password
I also wondered why this errored as well...
int(messege)
Is it not meant to convert a string to a number?
--
http://mail.python.org/mailman/l
[EMAIL PROTECTED] writes:
> Thanks everyone. I guess I was a little quick to think I could jump
> straight into Python.
Well, if you're willing to try diving into it instead of jumping, you
might like
http://diveintopython.org
--
http://mail.python.org/mailman/listinfo/python-list
Thanks everyone. I guess I was a little quick to think I could jump
straight into Python. I understand the principals of what was said but
not the code just yet. I was always under the impression that python
was a cleaned up version of perl. I guess this excercise put me
straight! I will try and g
[EMAIL PROTECTED] wrote:
> The perl version of this code works but not the python version. What am
> I doing wrong?
>
> message = "abc"
> password = "z12"
>
> scrambled = message ^ password
>
> I also wondered why this errored as well...
>
> int(messege)
>
> Is it not meant to convert a string to a
[EMAIL PROTECTED]:
Python is strongly typed, and it converts types automatically less
often than Perl.
The purpose of such strong(er) typing is to allow to catch some kind of
bugs, and to make the syntax simpler, more readable, etc.
> message = "abc"
> password = "z12"
> scrambled = message ^ pas
[EMAIL PROTECTED] schrieb:
> The perl version of this code works but not the python version. What am
> I doing wrong?
>
> message = "abc"
> password = "z12"
>
> scrambled = message ^ password
>
> I also wondered why this errored as well...
>
> int(messege)
>
> Is it not meant to convert a stri