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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 33 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply