Complete Task 4: extract_numbers() 1) Complete the extract_numbers() function. Mark Breakdown 2) 2 additional doctests a

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: 899603
Joined: Mon Aug 02, 2021 8:13 am

Complete Task 4: extract_numbers() 1) Complete the extract_numbers() function. Mark Breakdown 2) 2 additional doctests a

Post by answerhappygod »

Complete Task 4: extract_numbers()
1) Complete the extract_numbers() function.
Mark Breakdown
2) 2 additional doctests are created
a) Doctest output is accurate (0.5 marks x 2 = 1 mark)
b) Doctest passes (0.5 marks x 2 = 1 mark)
3) Does function pass all assignment doctests provided? (0.5
marks x 4 = 2 marks)
Complete Task 4 Extract Numbers 1 Complete The Extract Numbers Function Mark Breakdown 2 2 Additional Doctests A 1
Complete Task 4 Extract Numbers 1 Complete The Extract Numbers Function Mark Breakdown 2 2 Additional Doctests A 1 (64.5 KiB) Viewed 32 times
def extract_numbers (text): 75 76 ILIRII 77 78 79 Extract all the numerical digits in a text string. Allow duplicate values as digits. Sort the digits in reverse order :param text: string data :return: a list of all the digits values of the string sorted in reverse order 80 81 82 83 84 85 86 87 88 >>> extract_numbers ("Python 15-4 is COO!_") [5, 4, 1, 0, 0] >>> extract_numbers("Sample Param") [] >>> extract_numbers ("122333") [3, 3, 3, 2, 2, 1] >>> extract_numbers ("I won 1st prize out of 482 contestants") [8, 4, 2, 1] 89 90 91 92 Add 2 more Doctests 93 94 95 E pass # code goes here. Replace 'pass' with your own python code 96
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply