Question: Python pls Create a function call possible. This function takes a set and int to find if it's possible to use elements of the set

Python pls

Create a function call possible. This function takes a set and int to find if it's possible to use elements of the set to make the same number as the int argument. it returns True or False to see if it's possible

def possible(s, num):

#This should be a recursive function

#Do not use any other function, you only need one function

#do not import any other function

1. possible( {1}, 1 ) returns True.

2. possible( {1}, 2 ) returns False.

3. possible( {1, 5, 8, -2}, 4) returns True: 1 + 5 - 2 = 4 (8 is not used).

4. possible( {1, 5, 8, -2}, 10) returns False.

5. possible({32, 7, -85, 83, -44, 87, -70, 94}, 14) returns True: 32 -85 - 44 + 87 -70 + 94 = 14 (7 and 83 are not used).

6. possible({32, 7, -85, 83, -44, 87, -70, 94}, 6) returns False:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!