印刷中にPythonで指数を3乗するにはどうすればよいですか?
例えばprint ("3***cubed***")
数を 3 乗したくない - 記号が欲しい
前もって感謝します
このボリューム計算機を作りたい:
答えを教えてくれるときに最後に立方体で印刷したい:
height = input("Enter the height: ")
if int(height) <0:
print("Please enter a number larger than 0")
height = input("Enter the height: ")
if not int(height) < 2**31 - 1:
print("You have not entered a number")
height = input("Enter the height: ")
height = int(height)
width = input("Enter the width: ")
if int(height) <0:
print("Please enter a number larger than 0")
height = input("Enter the height: ")
if not int(height) < 2**31 - 1:
print("You have not entered a number")
height = input("Enter the height: ")
width = int(width)
length = input("Enter the length: ")
if int(length) <0:
print("Please enter a number larger than 0")
length = input("Enter the height: ")
if not int(length) < 2**31 - 1:
print("You have not entered a number")
length = input("Enter the length: ")
length = int(length)
volume = height*width*length
print ("The volume of the cuboid is" + str(volume) +"cm"