Odd numbers in a range
📁 python, пример, работа
Given two integers,
AandB.
It is necessary to output all odd numbers in the range fromAtoB.
UPD: Using theifstatement is prohibited!Input data:
The program receives two integers:AandB(A≤B), one per lineOutput data:
Output all odd numbers in the given range separated by spaces
Input data:
110Output data:
1 3 5
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