Python multiplication table using # on all even integers

I’m attempting to make a 2-10 multiplication table in Python. If you enter an invalid number, the system will notify you and prompt you to enter another number. It is also expected to append a # to all even integers. I’m having difficulties continuing after an invalid entry, and I’m also having trouble placing a # on all even integers. My current code is shown below.

def main():
rows = int(input("What size multiplication table would you like (2-10): "))
if rows <=1 or rows >10:
    print (" Invalid Entry - Enter a number between 2 - 10 ")
    counter = 0
def multiplicationTable(rows,counter):
size = rows + 1
for i in range (1,size):
    for nums in range (1,size):
        value = i*nums
        print(value,sep=' ',end="\t")
        counter += 1
        if counter%rows == 0:

While true: will run indefinitely naturally, according to this video. However, the secret is in the continue and break statements. Continue will cause it to restart at the top of the loop, whereas break will cause it to quit the loop after the procedure is completed. Is that good?

Second line in code will raise ValueError if user enters anything what is not convertible to int. So user input validation should deal with value (is it integer) and range (is it in desired range). For validation try...except...else is a good fit.

If while or for loop is used inside function one can break it with return.

If I understood the objective something like this could be written:

def main():
    size = validate("Choose multiplication table size in range 2...10: ")
    rows = stream(size)
    for row in rows:
        print('\t'.join(f"{num}" if num%2 else f"{num}#" for num in row))

def validate(request, boundary=range(2, 11)):
    while True:
        answer = input(request)
            size = int(answer)
            if size not in boundary:
                raise ValueError
        except ValueError:
            print(f"Expected integer in range {min(boundary)}...{max(boundary)} but input was {answer!r}")
            return size

def stream(rows):
    cycle = range(1, rows+1)
    return ((i*j for j in cycle) for i in cycle)

if __name__ == "__main__":