python - Why is the function not printing the sum of the values in the list? -


The objective of this program takes two values ​​for the 'fib', and keeps them through the Fibonacci sequence, Adding the words in the variable 'sequence', as it goes along. When it goes through the 'check' function and the boundary is crossed, then it will add value to the 'final' list, then after printing the sum of the 'finals'

The problem is that it does not matter which value it takes in Fib, 'last' does not always have any value. I am new to very programming and it does not seem to be that Why is doing ...

  def too (x): v = list (str (x)) [- 1] If v == '0' or v == '2' Or v == '4' or v == '6' or v == '8': return x and: return 0 def check (sequence): for sequence = [x, y] a = 0b = 1 last = [] While the lane (sequence) & lt; 100: word = sequence [a] sequence [b] sequence. Epand (word) if check (sequence) == 'border limit': For order V: Last.Epappand (even (V)) Print amount (final) break A + = 1B + = 1 < / Code>   

check any back If the first item in the list is less than 20.

You probably meant this:

  DIF check (sequence): for the sequence in V: if V & gt; = 20: Return 'reached the threshold' and: Return any    

Comments