Avatar ·

How to get the next user message in aiogram

📁 method

In telebot, this method looks like bot.register_next_step_handler.

How to get the next user message in aiogram?

Avatar ·

I would do it like this:

def prime_f(n):    if n%2 == 0: retu 2    i = 3    while n%i != 0 and i*i <= n:        i+= 2    if i*i <= n: retu i    retu nN = int(input())print(prime_f(N))

We check 2 separately, then only odd numbers, and up to the square root of N - otherwise N itself is prime.

Log in to leave an answer

Blogs