Question: coding in python, this is what i have so far but highest_factor keeps returning as 1 and i'm not sure why [20 pts) Write the

coding in python, this is what i have so far but highest_factor keeps returning as 1 and i'm not sure why

[20 pts) Write the function largeFactor(num) which takes in an integer num that is greater than 1. The function returns the largest integer that is smaller than num and evenly divides num. Example: largeFactor(15) will return 5 since the factors of 15 are 1, 3 and 5 largeFactor(7) will return 1 since 7 is prime def largeFactor(n): >>> largeFactor(15) # factors are 1, 3, 5 >>> largeFactor(80) # factors are 1, 2, 4, 5, 8, 10, 16, 20, 40 40 >>> largeFactor(13) # factor is 1 since 13 is prime # --- YOU CODE STARTS HERE factor_one = 1 while factor_one
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
