Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. def assembly_rec(num):
  2.     check_assembly = calculate_assembly(num)
  3.     if check_assembly is False:
  4.         return -1
  5.     return check_assembly
  6.  
  7. def calculate_assembly(num,assembly = 2,cur_num = 1):
  8.     if cur_num>num:
  9.         return False
  10.     if cur_num == num:
  11.         return assembly-1
  12.     return calculate_assembly(num,assembly+1,cur_num*assembly)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement