diff --git a/Project Euler/Problem 02/sol1.py b/Project Euler/Problem 02/sol1.py index 6cf520767..065af1ebd 100644 --- a/Project Euler/Problem 02/sol1.py +++ b/Project Euler/Problem 02/sol1.py @@ -8,11 +8,13 @@ e.g. for n=10, we have {2,8}, sum is 10. ''' n = int(raw_input().strip()) -i=1; j=2; sum=0 +i=1 +j=2 +sum=0 while(j<=n): if((j&1)==0): #can also use (j%2==0) sum+=j temp=i i=j j=temp+i -print sum \ No newline at end of file +print sum