V
V
Vanzent2015-10-10 10:03:57
Python
Vanzent, 2015-10-10 10:03:57

Python delite Python delite?

Delite this Delite this Delite this Delite this Delite this Delite this

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Kitaev, 2015-10-10
@deliro

There is no need to transfer such shitty code to python.
Use setattr, hasattr and getattr if you can't.

A
Artem Klimenko, 2015-10-10
@aklim007

There are several options, but stop here:

globals()['b'] = 2
print(b)

Better yet, get a dictionary:
d = {}
d['b'] = b
print(d['b'])

ps it is better to forget about the dynamic creation of local variables right away

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question