Question: Write a program in Python with the following: a) Function isPrime: - description: verifies if a whole number is prime. - input parameter: whole number.
Write a program in Python with the following:
a) Function isPrime:
- description: verifies if a whole number is prime.
- input parameter: whole number.
- return: True or False.
Remark: a prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.
b) Function isOdd:
- description: verifies if a whole number is odd.
- input parameter: whole number.
- return: True of False
c) Function power:
- description: calculates the exponentiation of a whole number.
- input parameters: whole number, exponent
return: number to the power of exponent.
-
This is an intro to programming class, it doesnt have to be a super complicated code. The simpler the better. Thank you
c) Function power: description: caculates the exponentiation of a whole number. input parameters: whole number, exponent return: number to the power of exponent c) Function main: description: using functions isPrime is0dd and power, show the odd prime nmbers between the numbers from 1 to 100 nclusive and the corresponding exponentiation values: n n nf and na In a table like the following: Odd Prime Power of Power of Power of Power of 27 25 125 343 121 1331 79 83 89 97 79 6241 493039 83 6889 571787 89 7921 704969 97 9409 912673 Show the results on the screen. For the coding, use: camel notation in-program comments logic Remark: you can't use any Math built-in function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
