Series11. Integers K, N and a set of N integers are given. If there are numbers in the set that are less than K, then output TRUE; Otherwise output FALSE.

Solution in Python 3:

import random

N = random.randrange(1,10)
print("N = ",N)
K = random.randrange(1,10)
print("K = ",K)
r = 0
for i in range(N):
x = random.randrange(3,15)
if x < K:
r += 1
print(x," : less than K - ",r)

if r > 0:
x = True
else:
x = False
print("There is a number less than K:",x)