Informatics Practices
Write a Python program to calculate and display the square and cube of an inputted number.
Python Funda
4 Likes
Answer
num = int(input("Enter a number"))
s = num ** 2
c = num ** 3
print("Square of", num, "is:", s)
print("Cube of", num, "is:", c)
Output
Enter a number4
Square of 4 is: 16
Cube of 4 is: 64
Answered By
1 Like
Related Questions
What will be the output of the following code?
for k in range(-10, 0, 2): print(k)
Differentiate between Cloud Computing and Grid Computing with suitable examples.
What will be the output of the following code?
Country=["India", "Australia", "USA", "China", "Russia", "Ukraine" ] print(Country[2:5]) print(Country[-5:-2])
Define Relation between IOT and WOT?