关于python的问题期末考试

编写demo函数,求n以内同时被3和7整除的自然数之和,并返回

把你写的代码发出来看看

def demo(n):
    s=0
    for i in range(21,n,21):
        s+=i
    return s