dxnge

tsk 5 (fnc)

Sep 20th, 2021
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. def nums(a, b) -> int:
  2.     if a > b:
  3.         return 0
  4.     if a == b:
  5.         return 1
  6.     if a < b:
  7.         return nums(a + 1, b) + nums(a * 2, b)
  8.  
  9. print(nums(1, 21) - nums(1, 10) * nums(10, 21))
Advertisement
Add Comment
Please, Sign In to add comment