Page 1 of 1

Write a function named get_max_multiples_of_3(sentence) that takes a sentence as a parameter. The sentence contains inte

Posted: Thu May 05, 2022 12:49 pm
by answerhappygod
Write A Function Named Get Max Multiples Of 3 Sentence That Takes A Sentence As A Parameter The Sentence Contains Inte 1
Write A Function Named Get Max Multiples Of 3 Sentence That Takes A Sentence As A Parameter The Sentence Contains Inte 1 (35.48 KiB) Viewed 34 times
python
Write a function named get_max_multiples_of_3(sentence) that takes a sentence as a parameter. The sentence contains integers each separated by white space. The function should do the following: • split the sentence into a list of values by calling the split() method • convert the list of values into a list of multiples of 3 • return the maximum value by calling the max () function Note: You can assume that the parameter sentence is not empty and contains at least one multiple of 3 integer. For example: Test Result 30 print (get_max_multiples_of_3('1 2 3 4 5 6 7 8 9 10 -1 -2 15 20 25 30')) print (get_max_multiples_of_3('1 2 3 2 1 6 3 4 5 2')) 6