I have two lists: (1) of primes (prime_list), and (2) of odd numbers (odd_list). I would like to find the highest prime under each odd number, but I am having some difficultly. For example, for odd number 99 I want to subtract 97.
I have been trying to use a "for loop" and max. Those concept I can grasp. I am sure there are other method, but I have only been more confused. See For Example: How to find the nearest prime number in an array, to another number in that array?
def max_prime():
for each_odd in odd_list:
print(max(prime_list))
if I add (
How can I do this clean? Is it possible using max and for loop?