Re: [Tutor] Fixing Globals

2013-03-17 Thread kendy
Thanks to everyone who responded. I learned from each person's response. The example code that I emailed was representative of many large programs that I've written in other languages. I've written many small Python scripts and I'm about to write a more complex Python script, much like the example

Re: [Tutor] func-question_y_n.py

2013-03-17 Thread Alan Gauld
On 17/03/13 17:40, Christopher Emery wrote: Could you point me to a really good and easy to under about string formatting? I am what I would say in programming a baby still on milk. (smile) You'll find an introduction to old style formatting in my tutorial topic "Simple Sequences". In that

Re: [Tutor] Script to generate statements

2013-03-17 Thread Charles Leviton
Many thanks to Peter, Steven, Dave and Alan as well. Especially Peter's hints about using the "with construct". I discovered the missing strip() the hard way! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://m

Re: [Tutor] Script to generate statements

2013-03-17 Thread Charles Leviton
Hi thanks for the response On Fri, Mar 15, 2013 at 5:43 PM, Hugo Arts wrote: > On Fri, Mar 15, 2013 at 9:03 PM, Hugo Arts wrote: > >> >> I have a few comments >> >> * Does the script work? If yes, I'd say it's probably fine. Pretty short >> so easy to understand whatever you do, and I see no ob

Re: [Tutor] func-question_y_n.py

2013-03-17 Thread Christopher Emery
Hello Alan, Thank you for your response! Could you point me to a really good and easy to under about string formatting? I am what I would say in programming a baby still on milk. (smile) Sincerely in Christ, Christopher > On 17/03/13 02:03, Christopher Emery wrote: > > Looks reasonable to me.

Re: [Tutor] func-question_y_n.py

2013-03-17 Thread Alan Gauld
On 17/03/13 02:03, Christopher Emery wrote: ### Start of Code ### def question_P_N(question, p, n): p = p.upper() n = n.upper() answer = input(question).upper() while answer not in (p, n): print("Your response was", answer + "!", "Please enter", p, "or", n, "for your