Created
August 21, 2016 21:23
-
-
Save Spotik/4a3d068615567bb35a132009ee8fd73f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| '''. 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