On 29/10/2012 01:40, Matthew Ngaha wrote:
In your original getNames do something like this.
Initialise a counter to zero.
Every time you get a valid name increment the count.
If the count is three you're finished.
hey i was looking at the question as im learning also. With the counter,
would you use a while loop instead of a for loop, with the condition being
something like, while count < 3: ? without len() the for loop option seems
difficult
Always use a while loop in this situation, regardless of whether or not
teachers put stupid artificial constraints on your code, such as banning
the use of len().
--
Cheers.
Mark Lawrence.
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor