(Jul-07-2021, 03:57 PM)deanhystad Wrote: int(num * num * num) does the operation inside the the parenthesis before converting to int. You can do this:
print((int(num)**3) # or num = int(num) print(num * num * num)
Oh ok i understand. But 1 question. First try i did this i for example put 3 to cube, and it splitted them into 333333333 instead of 27, why?
num = input("Enter a number to CUBE: ") result = int(num) def cube(): print(int(num * int(num) * int(num))) cube()