Nov-07-2022, 07:16 PM
i have a bunch of modules to import. their names are created by some code that uses a number in range(10,301) to make them. what is the most practical and pythonic way to do that? code might look like:
trouble is, the above code does not work as hoped because variable name does not get substituted.
is there a way to do this on a host with no writable storage space?
1 2 3 4 5 6 7 8 |
for number in range ( 10 , 301 ): x = number * number * number z = (x + 9999 ) % 1000 + 137 name = 'vmod' + str (z)[: 3 ] from {name} import calc as {name} ... ... ... |
is there a way to do this on a host with no writable storage space?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.