Question: WRITE IN PYTHON Write a function divisible(String s, int x) that takes a string s as a parameter and returns a list of all of

WRITE IN PYTHONWRITE IN PYTHON Write a function divisible(String s, int x) that takes

Write a function divisible(String s, int x) that takes a string s as a parameter and returns a list of all of the unique numbers contained in that string that are divisible by non-negative integer x, but do not include integer x within the number itself. For example, 24 and 16 are both divisible by 4, but 24 includes the number 4 so it is not counted. If there are no such numbers found in the string, the function will return an empty list. Consider all string inputs, even those containing numbers and letters. Letters will act as "blockers between numbers. For example, for the string "123a4, the numbers 123 and 4 should be checked but 1234 should not be. You may make helper functions if you see them as necessary. See the test cases below Input Output divisible("tothemoon, 1) divisible("a465839485739b102988c30jklol4, 7) divisible("a1234567890ef, 5) divisible("1782931, 1894792) divisible( Jennychangeyournumber8675309, 0) [0, 98, 1029, 3948, 6583948, 9485, 658, 58394] [0, 90, 890, 7890, 67890] [ ]

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!