[Tutor] How do I do cubic roots and cubic exponents (and higher roots and exponents) in Python?

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Tue May 9 07:23:49 CEST 2006



> How do I do cubic (and higher) roots and exponents in Python? I already 
> took a look in Python and didn't find anything.

Hi Nathan,

I think you're looking for the '**' operator.  Like addition and 
multiplication, it can take in two numbers.

##########
>>> 2 ** 2
4
>>> 2 ** 3
8
>>> 2 ** 4
16
##########


Best of wishes!


More information about the Tutor mailing list