J
John Salerno
Can someone tell me why 'n' in this example isn't 2?
for x in range(2, n):
print 'x =', x, 'n =', n
x = 2 n = 3
for x in range(2, n):
print 'x =', x, 'n =', n
x = 2 n = 3
[]John said:Can someone tell me why 'n' in this example isn't 2?
for x in range(2, n):
print 'x =', x, 'n =', n
x = 2 n = 3
Hint:
Can someone tell me why 'n' in this example isn't 2?
for x in range(2, n):
print 'x =', x, 'n =', n
x = 2 n = 3
Thanks guys! I was thinking range(2, 2) gave you 2, for some reason!Jesus said:It is, but range(2,2) doesn't do anything
Jesus Rivero - Neurogeek
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.