Scott Dunning <swdunn...@me.com> Wrote in message: > > On Mar 30, 2014, at 4:29 AM, Dave Angel <da...@davea.name> wrote: >> >> You're getting closer. Remember that the assignment shows your >> function being called with 10, not zero. So you should have a >> separate local variable, probably called I, which starts at >> zero, and gets incremented each time. >> >> The test in the while should be comparing them. >> > So, this is what I have now and it âworksâ but, instead of printing (s) > on seperate lines theyâre all on the same line? > > def print_n(s,n): > while n < 10: > print s * n > break > assert isinstance(s, str) > assert isinstance(n, int) > >
So much for getting closer. Go back to the version I replied to. Do you know how to define and initialize a second local variable? Create one called i, with a value zero. You test expression will not have a literal, but compare the two locals. And the statement that increments will change i, not n. -- DaveA
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor