Skip to content

Commit

Permalink
tightening up the prime function
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Marrone committed Sep 8, 2011
1 parent b22c9a8 commit 4ea5e93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 3 additions & 8 deletions 10.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import core

print "Finding the sum of all primes between 0 and 2.000.000"

list = core.primelist(range(0, 2000000))

primes = core.primelist(xrange(0, 2000000))
hold = 0

for _ in list:
hold += _

for i in primes:
hold += i
print "Summation is: " + str(hold)
4 changes: 3 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ do
line=`python -m profile $each | grep CPU`
line=$(echo "$line" | cut -d " " -f 14)
echo -e "*$line*"
if [ `$each % 10` -eq 0 ]; then
echo ""
fi
done
echo " ===== END LOG ===== "

0 comments on commit 4ea5e93

Please sign in to comment.