Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def assembly_rec(num):
- check_assembly = calculate_assembly(num)
- if check_assembly is False:
- return -1
- return check_assembly
- def calculate_assembly(num,assembly = 2,cur_num = 1):
- if cur_num>num:
- return False
- if cur_num == num:
- return assembly-1
- return calculate_assembly(num,assembly+1,cur_num*assembly)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement