Answer :
In python 3:
user_num = int(input("Enter integer: "))
print("You entered: {}".format(user_num))
print("{} squared is {}".format(user_num, user_num**2))
print("And {} cubed is {}!!".format(user_num, user_num**3))
user_num2 = int(input("Enter another integer: "))
print("{} + {} is {}".format(user_num, user_num2, user_num + user_num2))
print("{} * {} is {}".format(user_num, user_num2, user_num * user_num2))
I hope this helps!
Following are the Python program to input value and calculate its square and cube value.
Program Explanation:
- Defining a variable "user_num" that inputs integer value.
- In the next step, three print method is used that first prints input variable value and in the next two print method, it calculates square and cube value that print its value.
- After print, its value another variable "user_num1" is declared that uses the print method.
- Inside this, it adds and multiplies the input value and prints its values.
Program:
user_num = int(input("Enter integer: "))#defining a variable user_num that input value
print("You entered:",user_num)#using print method to print input value
print(user_num," squared is ", user_num**2)#calculating the square value and print its value
print("And", user_num , "cubed is", user_num**3, "!!")#calculating the cube value and print its value
user_num1 = int(input("Enter another integer: "))#defining a variable user_num that input value
print( user_num,"+",user_num1, "is", user_num + user_num1)#using print that add input value
print( user_num,"*",user_num1, "is", user_num *user_num1)#using print that multiply input value
Output:
Please find the attached file.
Learn more:
brainly.com/question/17961597
