mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-19 00:37:02 +00:00
fixed solution 4 of problem 1
This commit is contained in:
parent
a2b540f736
commit
10b0a40b2e
|
@ -9,7 +9,6 @@ def mulitples(limit):
|
||||||
if (result < limit):
|
if (result < limit):
|
||||||
zmulti.append(result)
|
zmulti.append(result)
|
||||||
temp += 1
|
temp += 1
|
||||||
continue
|
|
||||||
else:
|
else:
|
||||||
temp = 1
|
temp = 1
|
||||||
break
|
break
|
||||||
|
@ -18,15 +17,14 @@ def mulitples(limit):
|
||||||
if (result < limit):
|
if (result < limit):
|
||||||
xmulti.append(result)
|
xmulti.append(result)
|
||||||
temp += 1
|
temp += 1
|
||||||
continue
|
|
||||||
else:
|
else:
|
||||||
temp = 1
|
|
||||||
break
|
break
|
||||||
return (sum(zmulti) + sum(xmulti))
|
collection = list(set(xmulti+zmulti))
|
||||||
|
return (sum(collection))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print (mulitples(100))
|
print (mulitples(1000))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user