Can anyone break down this Python function into steps, so I understand how it works?: http://ideone.com/vPbIX
i also cannot understand how it works.
Right
What the function does is to determine all the primes lower than 10000 and tells you how much time to determine them it took
Store time when function was called For all number in range 'end' to '1' The number being tested (lets say x) if it is prime it only should be tested if not odd. If it is even verify if the rest the integer division of x by each number in the range 1 to sqrt (end) is 0 (prime numbers properties/theorem that states that each number to be verified as prime only need to be tested from 0 to sqrt(end)) if yes its prime store it print it whatever See current time subtract by previously stored time and print it
Join our real-time social learning platform and learn together with your friends!