Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The fourth root of (12) or any other number in Python 3

Tags:

I'm trying to make a simple code for power 12 to 4(12 ** 4) . I have the output num (20736) but when I want to figure returns (20736) to its original value (12). I don't know how to do that in Python .. in Real mathematics I do that by the math phrase {12؇}

The question is how to make {12؇} in Python ?? I'm using sqrt() but sqrt only for power 2

  #!/usr/bin/env python3.3
import math 
def pwo():
   f=12 ** 4 #f =20736 #
   c=        # should  c = 12 #
   return f,c
print pwo()
like image 615
Mr Sam Avatar asked Jul 11 '13 22:07

Mr Sam


1 Answers

def f(num):
    return num**0.25

or

import math
def f(num):
    return math.sqrt(math.sqrt(num))
like image 168
enderx1x Avatar answered Sep 24 '22 12:09

enderx1x