This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""By considering the terms in the Fibonacci sequence | |
whose values do not exceed four million, find the sum of the even-valued terms.""" | |
array=[1,2] | |
sum=0 | |
x=1 | |
y=2 | |
while y<4000000: | |
z=x+y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Find the sum of all the multiples of 3 or 5 below 1000. | |
"""I will define function mult() which returns true | |
if it's argument is divisible by 3 or 5.""" | |
def mult(x): | |
if x%3==0: | |
return True | |
elif x%5==0: | |
return True |
NewerOlder