Complete Task 2: odd_or_even() 1) Complete the odd_or_even() function. Mark Breakdown 2) 2 additional doctests are creat

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 2: odd_or_even() 1) Complete the odd_or_even() function. Mark Breakdown 2) 2 additional doctests are creat

Post by answerhappygod »

Complete Task 2: odd_or_even()
1) Complete the odd_or_even() 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.4
marks x 5 = 2 marks)
Complete Task 2 Odd Or Even 1 Complete The Odd Or Even Function Mark Breakdown 2 2 Additional Doctests Are Creat 1
Complete Task 2 Odd Or Even 1 Complete The Odd Or Even Function Mark Breakdown 2 2 Additional Doctests Are Creat 1 (70.41 KiB) Viewed 34 times
Edef odd_or_even(data): 27 28 29 II III 30 31 32 33 This function determines either a) if the numerical value is odd or even b) if the number of characters of a string is odd or even c) if the number of elements in a list or tuple is add or even d) If any other data type, there is no return :param data: either a number, string, list or tuple (all four data types must be acceptable) :return: either the text "odd" or "even" or no return 34 35 36 37 38 39 40 41 >>> odd_or_even("hello world") 'odd' >>> odd_or_even(1234) 'even' >>> odd_or_even (12.34) 'even'. >>> odd_or_even(list(range(2, 11))) 'odd' >>> odd_or_even(tuple("cool")) 'even' 42 43 44 45 46 47 Add 2 more Doctests 48 49 E 50 51 A pass # code goes here. Replace 'pass' with your own python code
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply