Ok, I got it running. Thank you!
I removed the space and top of that I had foul indentation in return
statement.
I'll try the approaches you suggest.
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 3, 11:17 am, Steve Holden <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Hi! Im new to Python and doing exercise found from internet. It is
> > supposed to evaluate expression given with postfix operator using
> > Stack() class.
>
> > class Stack:
> > def __init__(self):
> >
[EMAIL PROTECTED] wrote:
[...]
>
> Steve,
>
> How do you do "tokenList = split(expr)"? There is no builtin called
> "split".
>
> Mike
>
Sorry, that should have been a call to the .split() method of expr, i.e.:
tokenList = expr.split()
regards
Steve
--
Steve Holden +44 150 684 7255
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
| Hi! Im new to Python and doing exercise found from internet. It is
| supposed to evaluate expression given with postfix operator using
| Stack() class.
|
| class Stack:
| def __init__(self):
| self.items = []
|
| def pus
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>> There is a stray leading space in it.
>
> Nah, I'd say there's a stray ([^0-9]) after the space.
If you regard the spaces as being a required part of the postfix
grammar, it would be simpler. But who would design a language
where wh
On Apr 3, 8:57 am, [EMAIL PROTECTED] wrote:
> Hi! Im new to Python and doing exercise found from internet. It is
> supposed to evaluate expression given with postfix operator using
> Stack() class.
>
> class Stack:
> def __init__(self):
> self.items = []
>
> def push(self, item):
On Apr 3, 7:14 pm, "Richard Brodie" <[EMAIL PROTECTED]> wrote:
> <[EMAIL PROTECTED]> wrote in message
> >There may be something wrong with the "re" code in your example,
> >but I don't know enough about that to help in that area.
>
> There is a stray leading space in it.
Nah, I'd say there's a str
[EMAIL PROTECTED] wrote:
> Hi! Im new to Python and doing exercise found from internet. It is
> supposed to evaluate expression given with postfix operator using
> Stack() class.
>
> class Stack:
> def __init__(self):
> self.items = []
>
> def push(self, item):
> sel
<[EMAIL PROTECTED]> wrote in message
>There may be something wrong with the "re" code in your example,
>but I don't know enough about that to help in that area.
There is a stray leading space in it.
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 3, 10:57 am, [EMAIL PROTECTED] wrote:
> Hi! Im new to Python and doing exercise found from internet. It is
> supposed to evaluate expression given with postfix operator using
> Stack() class.
>
> class Stack:
> def __init__(self):
> self.items = []
>
> def push(self, item)
[EMAIL PROTECTED] wrote:
> Hi! Im new to Python and doing exercise found from internet. It is
> supposed to evaluate expression given with postfix operator using
> Stack() class.
>
> class Stack:
> def __init__(self):
> self.items = []
>
> def push(self, item):
> self.i
Hi! Im new to Python and doing exercise found from internet. It is
supposed to evaluate expression given with postfix operator using
Stack() class.
class Stack:
def __init__(self):
self.items = []
def push(self, item):
self.items.append(item)
def pop(self):
12 matches
Mail list logo