[ create a new paste ] login | about

Link: http://codepad.org/nFGaG6YR    [ raw code | output | fork ]

Python, pasted on Oct 6:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
x = int(raw_input('Enter an integer: '))
ans = 0
while ans**3 < abs(x):
        ans = ans + 1
if ans**3 != abs(x):
                print(str(x) + ' is not a perfect cube')
else:
     if x < 0:
        nt(raw_input('Enter an integer: '))
ans = 0
while ans**3 < abs(x):
        ans = ans + 1
if ans**3 != abs(x):
                print(str(x) + ' is not a perfect cube')
else:
     if x < 0:
        ans = -ans
                print('Cube root of' + str(x) + 'is' + str(ans))
~
~                                  
~                                                             


Output:
1
2
3
4
  Line 18
    print('Cube root of' + str(x) + 'is' + str(ans))
    ^
IndentationError: unexpected indent


Create a new paste based on this one


Comments: