M
Mladen Gogala
If I write things with the intermediate variables like below, everything
works:
['q', 'u', 'i', 'c', 'k', ' ', 'b', 'r', 'o', 'w', 'n', ' ', 'f', 'o',
'x', ' ', 'j', 'u', 'm', 'p', 's', ' ', 'o', 'v', 'e', 'r', ' ', 'a', '
', 'l', 'a', 'z', 'y', ' ', 'd', 'o', 'g']['g', 'o', 'd', ' ', 'y', 'z', 'a', 'l', ' ', 'a', ' ', 'r', 'e', 'v',
'o', ' ', 's', 'p', 'm', 'u', 'j', ' ', 'x', 'o', 'f', ' ', 'n', 'w',
'o', 'r', 'b', ' ', 'k', 'c', 'i', 'u', 'q']'god yzal a revo spmuj xof nworb kciuq'
That is all well and kosher. Now, if I try to shorten things up, I will
get a type error:
Traceback (most recent call last):
Why is TypeError being thrown? The reason for throwing the type error is
the fact that the internal expression evaluates to None and cannot,
therefore, be joined:
None
And that is strange. From the example above, I saw that if I assigned the
intermediate array to hold list(x), did the reverse on that variable and
then did "join", everything works as advertised. Version of Python is
2.6.5 on Ubuntu 10. Why is the intermediate variable necessary?
I am a complete newbie and am trying the usual stuff, reversing strings,
displaying them in hex, writing things to file "test1.txt" and alike.
works:
['q', 'u', 'i', 'c', 'k', ' ', 'b', 'r', 'o', 'w', 'n', ' ', 'f', 'o',
'x', ' ', 'j', 'u', 'm', 'p', 's', ' ', 'o', 'v', 'e', 'r', ' ', 'a', '
', 'l', 'a', 'z', 'y', ' ', 'd', 'o', 'g']['g', 'o', 'd', ' ', 'y', 'z', 'a', 'l', ' ', 'a', ' ', 'r', 'e', 'v',
'o', ' ', 's', 'p', 'm', 'u', 'j', ' ', 'x', 'o', 'f', ' ', 'n', 'w',
'o', 'r', 'b', ' ', 'k', 'c', 'i', 'u', 'q']'god yzal a revo spmuj xof nworb kciuq'
That is all well and kosher. Now, if I try to shorten things up, I will
get a type error:
Traceback (most recent call last):
Why is TypeError being thrown? The reason for throwing the type error is
the fact that the internal expression evaluates to None and cannot,
therefore, be joined:
None
And that is strange. From the example above, I saw that if I assigned the
intermediate array to hold list(x), did the reverse on that variable and
then did "join", everything works as advertised. Version of Python is
2.6.5 on Ubuntu 10. Why is the intermediate variable necessary?
I am a complete newbie and am trying the usual stuff, reversing strings,
displaying them in hex, writing things to file "test1.txt" and alike.