Jul-07-2021, 04:33 PM
You don't convert first
You convert with
Then it will be like this,now it clear that cube need a argument
num
to integer in function.You convert with
result
,but never use it.num = input("Enter a number to CUBE: ") result = int(num) def cube(): print(result * result * result) cube()But should not write as this function should take argument in like this,can also do convert on
input()
.Then it will be like this,now it clear that cube need a argument
num
in.def cube(num): print(num * num * num) if __name__ == '__main__': num = int(input("Enter a number to CUBE: ")) cube(num)