mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
Project Euler problem 2 pyhtonic solution (#629)
* Project Euler problem 2 pyhtonic solution * Project Euler problem 2 made small changes
This commit is contained in:
@@ -18,9 +18,7 @@ i=1
|
||||
j=2
|
||||
sum=0
|
||||
while(j<=n):
|
||||
if((j&1)==0): #can also use (j%2==0)
|
||||
if j%2 == 0:
|
||||
sum+=j
|
||||
temp=i
|
||||
i=j
|
||||
j=temp+i
|
||||
i , j = j, i+j
|
||||
print(sum)
|
||||
|
||||
Reference in New Issue
Block a user