PYTHON PROGRAMS

COMMENTS: Since many students now use computers rather than calculators I have converted
a few of my programs to computer programs. I have chosen the Python language for reasons
which I will not try to justify.

# This program gives the largest perfect power in a number, given a number
# and a root.
#It is taken from the TI-84 program PrfPwr by F. Kizer, and rewritten 11/23/14

#Program Name: PerfPwr.py 061716
import
math
N=float(input('Enter a number: '))
R=float(input('Enter a root: '))
s=math.floor(N**(1/R))                       #Finds largest possible square
for i in range (s, 0,-1):
if (N/i**R)==math.floor(N/i**R):         #ck to see if root = root truncated.
b=N/i**R
break                                                         #Gets out of loop when 1st sq detected
print ("Factored Number: ")
print (i**R, '*', b)                                      #Enters the factored number
print ("root of", i**R, "= ", i)                   #Prints root of perf pwr

This program solves for the roots of a quadratic.

#This file calculates the roots of a quadratic.