Message from Python discussions
April 2020
— Print('Hi')
Found a away at last
a = "id"+str(123)
b = test123
exec("{} = {}".format(a,b))
and when we type id123 we get test123 thats assigned to id123
— This was what i was asking for!
— But this is insecure, a very insecure. Say your user has an id like this : "exit()", here whole program will stop working
— Use f strings instead of format. 🤔, using exec this way feels hacky imo.
— You should use dict and never use exec or eval, unless you know what you are doing.
— Yep, b could be an arbitrary call to a function
— Do you think telegram ids havce exit()?
— They are integers
— While 1:
Q = input("Can anyone help me to grow
my YouTube chanel")
If Q=="Yes" : Print("Channel Name = Dark
Music Composing")
Else : Continue
— Still works the way i want as i am sure there's never gnna be an exit() in telegram user_id's
— But using exec or eval is not safe. And it bloats your code (when your bot has millions of users, you will have millions of variables) what prevents you from using dict?