Skip to content

Instantly share code, notes, and snippets.

@Spotik
Created August 21, 2016 21:23
Show Gist options
  • Select an option

  • Save Spotik/4a3d068615567bb35a132009ee8fd73f to your computer and use it in GitHub Desktop.

Select an option

Save Spotik/4a3d068615567bb35a132009ee8fd73f to your computer and use it in GitHub Desktop.
'''. Reescreva um programa anterior lendo um número inteiro adicional chamado Prim. Nesta versão o
programa deverá apresentar os N termos da sequência de Fibonacci que forem maiores que Prim.'''
numero = input("Informe um número:\n")
prim = input("Informe um número PRIM:\n")
count = 0
x = 1
y = 0
if y > prim:
print y
if x > prim:
print x
while count < numero:
x = x + y
y = x - y
count += 1
if x > prim:
print x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment