Sorry... forgot to add the code...
2008/2/11, Artur Sousa <[EMAIL PROTECTED]>:
>
>
> Hi. Just started on programming, as well on Python. I'm having a little
> problem:
>
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:
print a, 'equals', n, '*', a/n
break
else:
print a, 'is a prime number'
each of the first spaces should be a "Tab".
--
Sorry for any inconvenience...
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor