Advertisement
exDotaPro

fruits

Oct 30th, 2020 (edited)
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.15 KB | None | 0 0
  1. fruits = {
  2.     1: 'kiwi',
  3.     2: 'pear',
  4.     3: 'kiwi',
  5.     4: 'banana',
  6.     5: 'melon',
  7.     6: 'banana',
  8.     7: 'melon',
  9.     8: 'pineapple',
  10.     9: 'apple',
  11.     10: 'pineapple',
  12.     11: 'cucumber',
  13.     12: 'pineapple',
  14.     13: 'cucumber',
  15.     14: 'orange',
  16.     15: 'grape',
  17.     16: 'orange',
  18.     17: 'grape',
  19.     18: 'apple',
  20.     19: 'grape',
  21.     20: 'cherry',
  22.     21: 'pear',
  23.     22: 'cherry',
  24.     23: 'pear',
  25.     24: 'kiwi',
  26.     25: 'banana',
  27.     26: 'kiwi',
  28.     27: 'apple',
  29.     28: 'melon',
  30.     29: 'banana',
  31.     30: 'melon',
  32.     31: 'pineapple',
  33.     32: 'melon',
  34.     33: 'pineapple',
  35.     34: 'cucumber',
  36.     35: 'orange',
  37.     36: 'apple',
  38.     37: 'orange',
  39.     38: 'grape',
  40.     39: 'orange',
  41.     40: 'grape',
  42.     41: 'cherry',
  43.     42: 'pear',
  44.     43: 'cherry',
  45.     44: 'pear',
  46.     45: 'apple',
  47.     46: 'pear',
  48.     47: 'kiwi',
  49.     48: 'banana',
  50.     49: 'kiwi',
  51.     50: 'banana',
  52.     51: 'melon',
  53.     52: 'pineapple',
  54.     53: 'melon',
  55.     54: 'apple',
  56.     55: 'cucumber',
  57.     56: 'pineapple',
  58.     57: 'cucumber',
  59.     58: 'orange',
  60.     59: 'cucumber',
  61.     60: 'orange',
  62.     61: 'grape',
  63.     62: 'cherry',
  64.     63: 'apple',
  65.     64: 'cherry',
  66.     65: 'pear',
  67.     66: 'cherry',
  68.     67: 'pear',
  69.     68: 'kiwi',
  70.     69: 'pear',
  71.     70: 'kiwi',
  72.     71: 'banana',
  73.     72: 'apple',
  74.     73: 'banana',
  75.     74: 'melon',
  76.     75: 'pineapple',
  77.     76: 'melon',
  78.     77: 'pineapple',
  79.     78: 'cucumber',
  80.     79: 'pineapple',
  81.     80: 'cucumber',
  82.     81: 'apple',
  83.     82: 'grape',
  84.     83: 'orange',
  85.     84: 'grape',
  86.     85: 'cherry',
  87.     86: 'grape',
  88.     87: 'cherry',
  89.     88: 'pear',
  90.     89: 'cherry',
  91.     90: 'apple',
  92.     91: 'kiwi',
  93.     92: 'banana',
  94.     93: 'kiwi',
  95.     94: 'banana',
  96.     95: 'melon',
  97.     96: 'banana',
  98.     97: 'melon',
  99.     98: 'pineapple',
  100.     99: 'apple',
  101.     100: 'pineapple'
  102. }
  103.  
  104.  
  105. def get_next_digit(x):
  106.     x_as_int = int(x)
  107.     for d in x:
  108.         x_as_int -= int(d)
  109.     new_x = str(x_as_int)
  110.     return new_x
  111.  
  112.  
  113. n = input()
  114. new_n = get_next_digit(n)
  115.  
  116. while True:
  117.     if int(new_n) in fruits:
  118.         print(fruits[int(new_n)])
  119.         break
  120.     new_n = get_next_digit(new_n)
  121.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement