Avatar ·

Odd numbers in a range

📁 python, пример, работа

Given two integers, A and B.
It is necessary to output all odd numbers in the range from A to B.
UPD: Using the if statement is prohibited!

Input data:
The program receives two integers: A and B (AB), one per line

Output data:
Output all odd numbers in the given range separated by spaces

Input data:

110

Output data:

1 3 5 

                    
                
Avatar ·

You can use a state machine.

class Form(StatesGroup):    peremennaya = State() # Set state@dp.message_handler(commands=['start'])async def start(message: types.Message):    await bot.send_message(message.chat.id, 'Send your message:')    await Form.peremennaya.set() # Set the state@dp.message_handler(state=Form.a) # Accept state                                

Log in to leave an answer

Blogs