You are given a simple task of declaring a variable that equals the value of the cube of the given integer. Print the value of the resulting variable.
Calculating and printing the cube of an integer
Report a typo
Sample Input 1:
5Sample Output 1:
125Sample Input 2:
3Sample Output 2:
27Write a program in Python 3
# Start by taking an integer input from the user
n = int(input())
# Now you need to calculate the cube of the given integer. The cube of a number can be calculated
# by multiplying the number by itself twice. In Python, we can write it as: number * number * number
# After getting the cube, assign it to a variable.
# Finally, print the calculated cube of the given integer using the print function.
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.