Re: [Tutor] Why does loop duplicate?

2015-12-17 Thread Alan Gauld
On 16/12/15 19:37, Ken Hammer wrote: >... IDLE and Shell are Python 2.5.4 running on Windows 8.1. How exactly are you running this? Have you typed the code into a separate file using IDLE and then run it via the Run menu? Or are you importing the module at the >>> prompt? Or are you typing it in

Re: [Tutor] Why does loop duplicate?

2015-12-16 Thread Steven D'Aprano
On Wed, Dec 16, 2015 at 02:37:18PM -0500, Ken Hammer wrote: > Intent is to print "Jack, Kack, " with "O" and "Q" delivering a > longer suffix. Instead, I get the printout shown with duplicates and > a second deviation with "O" and "Q" as shown. Why? Are you absolutely sure about that? When

Re: [Tutor] Why does loop duplicate?

2015-12-16 Thread Mark Lawrence
On 16/12/2015 19:37, Ken Hammer wrote: Intent is to print "Jack, Kack, " with "O" and "Q" delivering a longer suffix. Instead, I get the printout shown with duplicates and a second deviation with "O" and "Q" as shown. Why? That's what you've told the code to do :) prefixes = 'JKLMNOPQ'

[Tutor] Why does loop duplicate?

2015-12-16 Thread Ken Hammer
Intent is to print "Jack, Kack, " with "O" and "Q" delivering a longer suffix. Instead, I get the printout shown with duplicates and a second deviation with "O" and "Q" as shown. Why? IDLE and Shell are Python 2.5.4 running on Windows 8.1. prefixes = 'JKLMNOPQ' ###FAILS WITH REPEATS suff