We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
l=[]
n = int(input())
for i in range(n):
m = int(input())
l.append(m)
for i in l:
q=[]
for m in range(1,i):
if m%3==0 or m%5==0:
q.append(m)
print(sum(q))
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #1: Multiples of 3 and 5
You are viewing a single comment's thread. Return to all comments →
l=[] n = int(input()) for i in range(n): m = int(input()) l.append(m) for i in l: q=[] for m in range(1,i): if m%3==0 or m%5==0: q.append(m) print(sum(q))