Re: [Tutor] Problem with "input" in Python 3

2010-02-15 Thread pja
Sorry about the previous post; I didn't check the code format before I posted the reply and thus lost all the indentation. Here I go again, hopefully with the correct indentation. # 7.2_quadratic2easy.py # A program that computes the real roots of a quadratic equation. # Bad version using a si

Re: [Tutor] Problem with "input" in Python 3

2010-02-15 Thread pja
Here is an interesting solution that I developed using the EasyGUI (http://easygui.sourceforge.net/) graphics library: # 7.2_quadratic2easy.py # A program that computes the real roots of a quadratic equation. # Bad version using a simple if to avoid program crash # This version uses the EasyGUI

Re: [Tutor] Problem with "input" in Python 3

2010-02-15 Thread pja
Kent, Thanks! That works well! Regards, Peter -- *Peter Anderson* There is nothing more difficult to take in hand, more perilous to conduct, or more uncertain in its success, than to take the lead in the introduction of a new order of things—Niccolo Machiavelli, /The Prince/, ch. 6 _

Re: [Tutor] Problem with "input" in Python 3

2010-02-15 Thread pja
Christian, You are a genius! There was one minor bug; the variable "in" needed to be changed to something like "in_value" and it works perfectly. Many thanks for that. Regards, Peter -- *Peter Anderson* There is nothing more difficult to take in hand, more perilous to conduct, or more uncert

[Tutor] Problem with "input" in Python 3

2010-02-15 Thread pja
Hi! I am trying to teach myself how to program in Python using Zelle's "Python Programming: An Introduction to Computer Science" (a very good text). At the same time I have decided to start with Python 3 (3.1.1). That means that I have to convert Zelle's example code to Python 3 (which genera

[Tutor] Problem with multiple input

2009-07-28 Thread pja
Hi! I am trying to teach myself Python (using John Zelle's book "Python Programming"). One major problem is that the book is written for Python 2.x and I am using Python 3.1 (and don't want to switch back). There is a sample script for calculating the sum and difference of two numbers: #