Difference between revisions of "Tugas irfan 18 sep 19"
(Created page with "x = 1 y = 1 z = 0 j = 0 print("n = ?") n1 = input() n = int(n1) n2 = n if (n2 == 1 or n2 == 2): z = 1 else: while(j < n - 2 ): z = x + y x = y...") |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | x = 1 | + | x = 1 |
− | y = 1 | + | y = 1 |
− | z = 0 | + | z = 0 |
− | j = 0 | + | j = 0 |
− | print("n = ?") | + | print("n = ?") |
− | n1 = input() | + | n1 = input() |
− | n = int(n1) | + | n = int(n1) |
− | n2 = n | + | n2 = n |
− | if (n2 == 1 or n2 == 2): | + | if (n2 == 1 or n2 == 2): |
z = 1 | z = 1 | ||
− | else: | + | else: |
while(j < n - 2 ): | while(j < n - 2 ): | ||
z = x + y | z = x + y | ||
Line 15: | Line 15: | ||
y = z | y = z | ||
j = j + 1 | j = j + 1 | ||
+ | print("suku ke " + n1 + ":") | ||
+ | print(z) | ||
− | + | [[File:irfant218.png]] | |
− |