# Function to check if a number is prime def is_prime(num): if num <= 1: return False for i in range(2, int(num ** 0.5) + 1): if num % i == 0: return False return True # List to hold the prime numbers prime_numbers = [] # Iterate through three-digit numbers starting with 5 for num in range(500, 600): if is_prime(num): prime_numbers.append(num) # Display the prime numbers print("Three-digit prime numbers starting with 5:") for prime in prime_numbers: print(prime)