Odd numbers in a range
📁 Advanced Python Topics, example, work
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
Blogs
How to change the maximum upload file size in PHP: a complete guide
Array<Type> vs Type[] in TypeScript: 5 Fatal Mistakes and How to Avoid Them
C# Everywhere: How to Write Cross-Platform Applications Without Pain
Canary Deployments in Swift: How to Roll Out Features Without Fear