Tugas irfan 18 sep 19

From ccitonlinewiki
Revision as of 17:40, 18 September 2019 by Irfanrah (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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
       y = z
       j = j + 1

print("suku ke " + n1 + ":") print(z)