PYTHON

profileschoolanswers

This assignment requires one file containing a main function and a recursive function named power.

In main:

  • prompt the user to enter an integer for the base of the power.
  • prompt the user for an integer for the exponent of the power.
  • call the power function and print its returned value.

The recursive power function, power(base,exponent), must recursively calculate the value of the power and then return it.

SAMPLE OUTPUT
Enter an integer for the base: 2
Enter an integer for the exponent: 5
2 to the power 5 equals 32

SAMPLE OUTPUT
Enter an integer for the base: 3
Enter an integer for the exponent: 4
3 to the power 4 equals 81

 

 

 

Make sure there is pseudocode and I'm using python version 3.4.2 

    • 11 years ago
    • 13
    Answer(2)

    Purchase the answer to view it

    blurred-text
    NOT RATED
    • attachment
      power.zip
    • attachment
      pseudo_code.txt
    • attachment
      pseudo_code.txt

    Purchase the answer to view it

    blurred-text
    NOT RATED
    • attachment
      exponentials.zip
    Bids(0)