Create a Raptor program that allows the user to enter a number . Display the cube of each number from 1 to the entered number. For example if the user enters 3, the computer would sum 1 X 1 X1+ 2 X 2 X 2 + 3 X3 X 3. The output would be 36.

Please show me how to do this.

Respuesta :

fichoh

The Raptor program written in python 3 which sums the cube of each number from 1 up to a given value is as follows :

  • user_input = int(input())
  • cube_sum = 0
  • for i in range(1 , user_input+1):
  • cube = i**3
  • cube_sum+=cube
  • print(cube_sum)

  • First line takes input from the user
  • Line 2, is an initialized variable for the sum of the cubed values
  • Line 3, a for loop which iterates values from 1 up to the stated user input
  • Line 4, takes the cube of each iterated value
  • Line 5, each cubed value is added to the cube_sum variable.
  • Line 6, displays the final output of cube_sum

Learn more : https://brainly.com/question/24728884