Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a recursive function named get_multiples_of_3(numbers) that takes a list of integers as a parameter and returns a list of numbers which are divisible by
Write a recursive function named get_multiples_of_3(numbers) that takes a list of integers as a parameter and returns a list of numbers which are divisible by 3, in the same order as the given parameter. The function should return an empty list if there are no numbers which are divisible by 3 in the parameter list. Note: This function has to be recursive; you are not allowed to use loops to solve this problem! Write a recursive function named no_multiples_of_3(numbers) which takes a list of integers as a parameter and returns False if the parameter list contains any values which are divisible by 3, and returns True (i.e. all numbers are NOT divisible by 3) otherwise. Note: this function has to be recursive; you are not allowed to use loops to solve this problem! For example: Test Result print(no_multiples_of_3([2, 3, 5, 6])) False print(no_multiples_of_3([2])) True print(no_multiples_of_3([1, 3, 5, 7])) False print(no_multiples_of_3([])) True
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started