def is_prime(n): """Check if a number is prime.""" if n <= 1: return False for i in range(2, int(n**0.5) + 1): if n % i == 0: return False return True def find_primes_starting_with_5(): """Find all three-digit prime numbers starting with 5.""" primes = [] for num in range(500, 600): if is_prime(num): primes.append(num) return primes # Print the prime numbers primes = find_primes_starting_with_5() for prime in primes: print(prime)