Please reply to the list (or at least include it) and not just
the person responding.
> i have tried upto two varibles but i want it to extend to mny more . I
> just need an idea. i have tried like this
> a=int(raw_input())
> b=int(raw_input())
> print "please enter operator"
> operator=raw_input
Sukhpreet Sdhu wrote:
i want to write a program that reads simple arithematic epressions and
calculates the result.
for example input "1*3+2" should generate "5'" as result
I'm happy to learn somebody else took the same path that I did to learn Python!
First of all, a disclaimer: I'm NOT pre
complex. Also it doesn't allow
>for parenthesised sub expressions etc. This is actually quite tricky to get
>right,
>but a very good learning exercise! (But much harder than you probably
>thought it would be!)
>
>
>HTH
>
>
>
>_
On 22/03/12 22:14, Sukhpreet Sdhu wrote:
i want to write a program that reads simple arithematic expressions and
calculates the result.
OK, there are many ways to do this but they pretty much
fall into three categories:
1) read the string and exec() it - easy but very
risky from a security
On 22/03/2012 22:14, Sukhpreet Sdhu wrote:
i want to write a program that reads simple arithematic epressions and
calculates the result.
for example input "1*3+2" should generate "5'" as result
___
Tutor maillist - Tutor@python.org
To unsubscribe
BlackBerry wireless device from MTN
-Original Message-
From: Sukhpreet Sdhu
Sender: tutor-bounces+delegbede=dudupay@python.org
Date: Fri, 23 Mar 2012 06:14:41
To: tutor@python.org
Reply-To: Sukhpreet Sdhu
Subject: [Tutor] python arthematics
>i want to write a program that reads simple arithematic epressions and
>calculates the result.
>for example input "1*3+2" should generate "5'" as result
So what is stopping you?
Snark aside, this can get really complicated unless you make some well
defined rules. This becomes difficult especiall
i want to write a program that reads simple arithematic epressions and
calculates the result.
for example input "1*3+2" should generate "5'" as result___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.pytho