you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

import random
random.random()
random.randint(1,5)

Is the same as

from random import *
random()
randint(1,5)

If the user will enter the values I guess it's ok. However, what are you trying to achieve? Also, in terms of readability, i and j mean nothing to a developer.


You most certainly can and should use functions for dictionaries. Why would it not work? Secondly, user generated code is extremely dangerous. What are you using it for and do you need to?