Re: [Tutor] python arthematics

2012-03-23 Thread Prasad, Ramit
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

Re: [Tutor] python arthematics

2012-03-23 Thread Francesco Loffredo
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

Re: [Tutor] python arthematics

2012-03-22 Thread ALAN GAULD
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 > > > >_

Re: [Tutor] python arthematics

2012-03-22 Thread Alan Gauld
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

Re: [Tutor] python arthematics

2012-03-22 Thread Mark Lawrence
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

Re: [Tutor] python arthematics

2012-03-22 Thread delegbede
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

Re: [Tutor] python arthematics

2012-03-22 Thread Prasad, Ramit
>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

[Tutor] python arthematics

2012-03-22 Thread Sukhpreet Sdhu
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