Feb-26-2019, 07:39 PM
I understand your explanation, but I still have problems to translate.
I'm confused by the combination of the wile and for lus.
The wile lus generates the fibonacci numbers if I understand it well, and the for lus the place?
I'm confused by the combination of the wile and for lus.
The wile lus generates the fibonacci numbers if I understand it well, and the for lus the place?
position_in_fib_sequence = int(input("Which fibonaccinumber do you want to know?")) the_number_has_to_be_bigger_than = int(input("Bigger than?")) G1 = 0 G2 = 1 i = 0 while G2 < position_in_fib_sequence: G1, G2 = G2, G1 + G2 print("The", str(position_in_fib_sequence) + "th", "fibonaccinumber bigger than", the_number_has_to_be_bigger_than, "is", G2) for i in range(position_in_fib_sequence-1): G1, G2 = G2, G1 + G2 print(G1, G2)