On 20/07/12 02:01, Ross Wilson wrote:
More specifically, eval() is dangerous if you try to evaluate a string
supplied by someone else. You really can't predict what will happen.
It really doesn't matter who provides the string, Python and eval()
don't care. They will behave just as
On 20/07/12 17:25, Alan Gauld wrote:
On 20/07/12 02:01, Ross Wilson wrote:
More specifically, eval() is dangerous if you try to evaluate a string
supplied by someone else. You really can't predict what will happen.
It really doesn't matter who provides the string, Python and eval()
don't
On 20/07/12 11:31, Ross Wilson wrote:
But what is the difference if I write incorrect code and *execute* it or
write an the same code in a string and *eval()* it. The result is the
same whether eval() is used or not. Same result, same risk.
No, a much bigger risk because you can manipulate
Hi folks,
I've been trying to convert numbers from digits to words, I wrote the
following code;
units = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight',
'nine']
teens = ['eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen',
'seventeen', 'eighteen', 'nineteen']
tens =
On 07/19/2012 08:36 PM, Osemeka Osuagwu wrote:
snip...
99 ninety nine
100 onehundred
101 one hundred and one
102 one hundred and two
103 one hundred and three
104 one hundred and four
105 one hundred and five
106 one hundred and six
107 one hundred and seven
108
Traceback (most recent
On 20/07/12 10:45, Dave Angel wrote:
On 07/19/2012 08:36 PM, Osemeka Osuagwu wrote:
snip...
99 ninety nine
100 onehundred
101 one hundred and one
102 one hundred and two
103 one hundred and three
104 one hundred and four
105 one hundred and five
106 one hundred and six
107 one hundred and seven