Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN PYTHON PLEASE Create a program that takes in a base and exponent for the user. If the input is valid, it prints the answer
IN PYTHON PLEASE
Create a program that takes in a base and exponent for the user. If the input is valid, it prints the answer of the base taken to the power given. You must require the user to give ints for both the base and the exponent. Also, the exponent must be zero or larger. Enter a base: 2 2 Enter a power: 3 Answer: 8 Enter a base: 256 Enter a power: 1 Answer: 256 Enter a base: 256 Enter a power: 0 Answer: 1 Enter a base: -1 Enter a power: 3 Answer: -1 Enter a base: 2 : 2 Enter a power: -1 Sorry, your exponent must be zero or larger. Enter a power: -1 Sorry, your exponent must be zero or larger. Enter a power: -1 Sorry, your exponent must be zero or larger. Enter a power: -1 Sorry, your exponent must be zero or larger. Enter a power: -1 Sorry, your exponent must be zero or larger. Enter a power: 10 Answer: 1024 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started