Im a student at a local technology college and I am taking a program design class. I have been trying to turn some of the programs we design in class into python programs but it is proving to be VERY problematic. The main problem I am having at the moment is that modules(functio n) cannot use variables from another module(function ). Is there a way to do that?
a question on variables
Collapse
X
-
Tags: None
-
Originally posted by chainsinthewallIm a student at a local technology college and I am taking a program design class. I have been trying to turn some of the programs we design in class into python programs but it is proving to be VERY problematic. The main problem I am having at the moment is that modules(functio n) cannot use variables from another module(function ). Is there a way to do that?
>>> from macrolib.inch_p rint import inch_print
>>> idx_list = indexList([inch_print(num) for num in [12.2, 15.5, 17.7, 25.5, 12.2]], '12 3/16')
>>> idx_list
[0, 4]
>>> [/code]The variables used in the functions are not accessible, but an object or objects can be returned and assigned to a name.
Comment