fork download
  1. aa = 0
  2. a = 1
  3. fim = int(input('Digite um termo: '))
  4. for n in range (0, fim):
  5. s = (aa + a)
  6. print(s, end = ' → ')
  7. aa = a
  8. a = s
  9. print()
  10. s = 0
  11. while s <= fim:
  12. if s % 2 == 0:
  13. print(s, end=' → ')
  14. s = s + 1
  15.  
  16. #https://pt.stackoverflow.com/q/411542/101
Success #stdin #stdout 0.02s 9292KB
stdin
10
stdout
Digite um termo: 1 → 2 → 3 → 5 → 8 → 13 → 21 → 34 → 55 → 89 → 
0 → 2 → 4 → 6 → 8 → 10 →