Computer Science, asked by Dnyaneshwari4, 2 months ago

create a Python program that takes a number from the user and counts the numbers between the number enter and its square ​

Answers

Answered by divyanshu629
1

""" I think you are asking for creating a python program which would take a number from the user and return the sum of square of all the numbers until the number user has entered """

# Let's take the input number from the user

number = int(input("Enter a number:"))

# Function to sum the squares of all the numbers

def square_sum(num):

sum = 0

while (num >= 1):

sum += num ** 2

num -= 1

return sum

# Testing the function

result = square_sum(number)

print(result)

Similar questions