Answer the question
In order to leave comments, you need to log in
What is "@" used for in front of variables in Python?
Hello, I recently started studying the topic of creating telegram bots, and in all the guides, the "dp" variable, which is an instance of the Dispatcher class, is preceded by the "@" symbol. I do not like to just copy someone else's code, so I would like to know what it is used for in this and other cases.
Code snippet where this symbol is used:
# tg bot init
api = Bot(token = config.TG_API_TOKEN)
dp = Dispatcher(api)
@dp.message_handler()
async def echo(message : types.Message) :
await message.answer(message.text)
Answer the question
In order to leave comments, you need to log in
For you to ask yourself this question and discover the benefits of textbooks . An entire chapter is devoted to the question!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question