Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Python: How to create Power function

Python: How to create  Power function
{filelink=16201}

def power(x, n):
    if n == 0:
        return 1
    else:
        return x * power(x, n-1)
print power(2,8) # 256

Users who found this page were searching for:

  • python percentage in class
  • java ComputeCrc32Hash
  • java how to print out enum types
  • python email message_from_string
  • build array with list in python
  • Python read zip content
  • how to read mail from yahoo with java mailing
  • Drawing a Checkerboard in Java

No comments yet.

Leave a Comment