>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 especially when you think about whether you want to support order of operations. Should “1+3*2” generate “7” or “8”? Do you want to support longer expressions or just 2 operations? Personally, if I were learning the language I would make it do 1 operation. Then after that I could consider how to make it do more operations. Turning it into a true arithmetic calculator might be a bit much to start with. Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423 -- This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email.
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor