import secrets

import time

def rand_generator(start, stop):
    rand_num = secrets.randbelow(stop - start + 1) + start
    return rand_num


while True:
    start = int(input("enter the first number:"))
    stop = int (input("enter the second number: "))
    if start > stop:
        print("the second number must be same or greater then first number")
    else:
        break

stop_flag = False
start_flag = False
stats = 0
start_time = time.time()

while True:
    stats += 1
    a_rand_num = rand_generator(start, stop)
    if a_rand_num == start:
        start_flag = True
    elif a_rand_num == stop:
        stop_flag = True
    elif a_rand_num < start or a_rand_num> stop:
        print("Error")
        break
    if stop_flag == True and start_flag == True:
        print('start and stop number were gererated')
        print('look at my', stats, 'attempted and time taken')
        end_time = time.time()
        print('Time taken:', end_time - start_time)
        break