daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest Jan 29th, 2018 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. x = int(input())
  2. while x != 0:
  3.         flowers, leaves, steps = 0, 0, 0
  4.  
  5.         while x != 1 and steps < 16:
  6.             if x%2 == 0:
  7.                 x = x / 2
  8.                 flowers = flowers + 1
  9.             else:
  10.                 x = (3*x) + 1
  11.                 leaves = leaves + 1
  12.                 steps = steps + 1
  13.  
  14.         if steps < 16:
  15.             print('TAK{}{}'.format(flowers,leaves))
  16.         else:
  17.             print('NIE')
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top