Home > other >  Python how to call other functions in one of the return value...
Python how to call other functions in one of the return value...

Time:09-18

Def filter () :
MiniMortgages=[]
StandardMortgages=[]
JumboMortgages=[]
For I in mortgage (mortgages) :
If i<200000:
MiniMortgages. Append (I)
Elif i>=200000 and i<=467000:
StandardMortgages. Append (I)
The else:
JumboMortgages. Append (I)
Return miniMortgages standardMortgages, jumboMortgages

The above code returned to the three lists, then I want to take each of these three lists below how to take,,,

For I in miniMortgages:
If i> 2000000:
Print (' not all miniMortgages are below 200000 ')
The else:
Print (' all of the miniMortgages are below 200000 ')

CodePudding user response:

Return miniMortgages standardMortgages, jumboMortgages
The meaning of this sentence is to return a tuple, the tuple has three list
Calls can be so
For I in the filter () :
This is I the above three lists in the tuple, then deal with them

CodePudding user response:

reference 1st floor chuifengde response:
return miniMortgages, standardMortgages, jumboMortgages
The meaning of this sentence is to return a tuple, the tuple has three list
Calls can be so
For I in the filter () :
This is I the above three lists in the tuple, then processing them

Ok thank you
  • Related