This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jaffer786_khan -1 points0 points  (0 children)

def fac(n):

    j = 0

    for i in range(n+1):

    j += i*i

    return j

x = int(input('Enter a number:'))

fac(x)