我有这个代码:
def dataExtractor():
# ***
# some code here
# ***
for tr in rows:
cols = tr.findAll('td')
if 'cell_c' in cols[0]['class']:
# ***
# some code here
# ***
stringed_list_of_params = [str(i) for i in (listOfParams[1],listOfParams[3])]
numerical_list_of_codes_units = [int(i) for i in (listOfParams[0],listOfParams[2])]
numerical_list_of_rates = [float(i) for i in (listOfParams[4])]
我需要构造这个函数:
def calc():
oneCurrency = (
#digital_code[0]
numerical_list_of_codes_units[0],
#letter_code[1]
stringed_list_of_params[0],
#units[2]
numerical_list_of_codes_units[1],
#name[3]
stringed_list_of_params[1],
#rate[4]
numerical_list_of_rates
)
# ***
# some code
# ***
但是我无法访问numerical_list_of_codes_units[0]
等,如何将变量从一个函数传递给另一个函数?