Python changes an empty list to an integer -
So I had to write my problem function statement (), which would list the temporary point numbers as positive input The number that draws from a bank account and represents the number of negative numbers your function should return two floating-point number-beer lists; The first deposit will be the amount, and the second (a negative number) will be the sum of withdrawals.
And what I wrote, it looks like changing the blank list to return 0, thus the append function is not allowed to work. I was wondering if a reason the dragon is doing this, or if this is just a strange error?
The code for reference is:
def statement (lst): "" "returns a list of two numbers; positive numbers (deposit) The sum of the sum is, and the other is the sum of the negative numbers (withdrawals) deposits, withdrawals, the last = []. For the [], [] in L: print (L) if L & LT; 0: print (' Expiry (withdrawal), withdrawal), Examination (L) Print ('clearance', clearance) # Examination Other: Print ('deposit amount', deposit) # Examination deposit. L) Print ('deposit', deposit) # Examination withdrawal = amount (withdrawals) deposits = amount (deposits) Last withdrawal (deposit) Last withdrawal (withdrawal)
These lines:
withdrawals = amount (withdrawals) deposits = amount (deposits) final.append (deposit amount) The final bill should be written in this form: final.append (amount (deposit)) final.append (amount (< / Code> Otherwise, clearance and plus to sum Wara were re-code the integer objects returned>. In other words, they will no longer mention the list object created here: deposits, withdrawals, final = [], [], []
Comments
Post a Comment