[Tutor] Problem with "input" in Python 3

2010-02-15 Thread Peter Anderson
I seem to be having a formatting problem between Thunderbird on my PC and the mailing list; I am loosing all indentation. The Gmail account settings on Thunderbird are for plain text and I set the e-mail content to fixed width text so I'm not sure what's going wrong. I am trying one last time sendi

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 Dave Angel
Peter Anderson wrote: 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

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

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

2010-02-15 Thread Wayne Werner
On Mon, Feb 15, 2010 at 6:09 AM, Peter Anderson < peter.ander...@internode.on.net> wrote: > 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 Pyt

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

2010-02-15 Thread Kent Johnson
On Mon, Feb 15, 2010 at 7:34 AM, pja wrote: > 05 import math > 06 > 07 def main(): > 08 print("This program finds the real solutions to a quadratic\n") > 09 > 10 a, b, c = input("Please enter the coefficients (a, b, c): ") > 11 > 12 ''' > 13 a = int(input("Please enter the first coefficient: "))

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

2010-02-15 Thread Christian Witts
pja wrote: 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 (

[Tutor] Problem with "input" in Python 3

2010-02-15 Thread Peter Anderson
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 "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