Cube root calculation

Post Reply
Posts: 1
Joined: Sun May 20, 2018 6:28 pm

Cube root calculation

Post by sairammohan » Wed May 23, 2018 4:15 am


Here is my question:

Input Format :
Input consists of 2 integers which corresponds to the volume and the number of cargos, respectively.

Output Format :
Output consists of a single integer, which corresponds to the volume of the container.

Sample Input:
Sample Output:

My Solution is:

a= input()
b = input()
s1 = int (a ** (1/3))
print (s1)
s2 = int (b ** (1/3))
print (s2)
print ((s1*s2) ** 3)

Am seeing this error:
Traceback (most recent call last):
File "C:\Working\Learnings\Python\Python Bible\", line 3, in <module>
s1 = int (a ** (1/3))
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'float'

Can any please help on this? Thanks in advance.

Post Reply

Return to “Python Language Elements”