Answer:
def sum_cubes(n):
if n == 1:
return 1
else:
return n * n * n + sum_cubes(n-1)
print(sum_cubes(3))
Explanation:
Create a function called sum_cubes that takes one parameter, n
If n is equal to 1, return 1. Otherwise, calculate the cube of n, and add it to the sum_cubes function with parameter n-1
If we want to calculate the cubes of the first 3 numbers:
sum_cubes(3) = 3*3*3 + sum_cubes(2)
sum_cubes(2) = 2*2*2 + sum_cubes(1)
sum_cubes(1) = 1
If you substitute the values from the bottom, you get 27+8+1 = 36
<h2>
Answer:</h2>
Title bar is the top most bar of a window. As obvious from the name, it has the title of the program in use. It has name of the program or more specifically the name of currently open document is written in this horizontal bar.
The option/commands present in the right most o the title bar are as follows:
- Close
- Maximize/Resize
- Minimize
Close command is needed to exit the program/application. A cross icon is used as close command. Maximize/Resize command helps to expand the window to the screen pane as well as allows the user to adjust the screen of application accordingly. Two squares icon is used as a button for this command. Minimize command helps by shutting the app to the task bar so that it can be expanded/maximized later. A dash/line icon is used as a button for this command.
<h2>I hope it will help you!</h2>