Artur Sousa wrote: > Sorry... forgot to add the code... > > 2008/2/11, Artur Sousa <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>: > > > Hi. Just started on programming, as well on Python. I'm having a > little problem:
It helps if you describe the problem. If you are getting an error message, copy/paste the entire error message, including the traceback, into your email. > What's the difference between: > > > for n in range(2, 10): > for x in range(2, n): > if n % x == 0: > print n, 'equals', x, '*', n/x > break > else: > # loop fell through without finding a factor > print n, 'is a prime number' > > and > > > for a in range(2, 10): > for n in range(2, a): > if a % n ==0: The above line is missing an indent, it needs to be indented more than the 'for' line. Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor