S
S
Samad_Samadovic2021-08-05 22:44:40
Python
Samad_Samadovic, 2021-08-05 22:44:40

How to change the name of a variable on the go?

I have a variable A_0 and while running the code, 0 should increase (A_0, A_1, A_2, etc.)
Or, more precisely, how to create variables in one line (there can be more than 100)
Code:

Enline_key_board = InlineKeyboardMarkup()
Account = InlineKeyboardButton("Завести аккаунт", callback_data='Account_button')
Enline_key_board.add(Account)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2021-08-05
@sergey-gornostaev

If you need this, then you are doing something very much wrong. It looks like you need to use a list.

F
freemailroot, 2021-08-06
@freemailroot

Can be created using the exec() method, but it is not clear why

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question