anonymous
  • anonymous
I cant find the definition for divisor anywhere, for this divisor = 2 for num in range(0, 10, 2):
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
chestercat
  • chestercat
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
you have defined divisor as 2 you have assigned 2 to divisor divisor in this instance is a 'variable' pointing to the integer 2 http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#other-languages-have-variables
goformit100
  • goformit100
POST THE QUESTION IN THE MATHEMATICS SECTION
anonymous
  • anonymous
Actually what I meant was 'what does divisor mean in the context of the whole loop, which finishes with print(num / divisor)

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
the shell is a great place to try things out http://dpaste.com/810583/
anonymous
  • anonymous
That's what I meant, knowing that divisor is simply the number by which the original numbers are divided by, of course its obvious in retrospect !
anonymous
  • anonymous
Actually still not entirely sure about this one
anonymous
  • anonymous
Is ' num in range(0,10,2') refer to range 0 to 10 but every alternate number, then that divide by the divisor, which is 2 ?
anonymous
  • anonymous
pretty much http://docs.python.org/tutorial/controlflow.html#for-statements http://docs.python.org/library/functions.html#range http://docs.python.org/reference/compound_stmts.html#the-for-statement
anonymous
  • anonymous
Thanks
rsmith6559
  • rsmith6559
No. When range is called with three arguments, the. first is start value, the second is end value and the third is the step. num in range( 0 , 10, 2 ) will give 0, 2, 4, 6, 8
anonymous
  • anonymous
So the last value is step or stride
rsmith6559
  • rsmith6559
When called with three arguments, yes.

Looking for something else?

Not the answer you are looking for? Search for more explanations.