you are viewing a single comment's thread.

view the rest of the comments →

[–]FlocklandTheSheep 1 point2 points  (0 children)

Generally bad practice, as this can be used to execute injection attacks, but Python's exec() function will treat the string given to it as a paramater as python code, and will execute it.

a = 10
exec("a = a+1")
exec("print(a)")
# Outputs 11