Question: This function accepts one parameter returns either 'odd', 'even' or None. The function determines whether or not a ) if the numerical value is odd

This function accepts one parameter returns either 'odd', 'even' or None.
The function determines whether or not
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, set or tuple is add or even
d) If any other data type, there is no return
NOTE: you are required to add the neccessary paramaters, method body and return statement.
NOTE: you are expected to determine the data type of the parameter and return the appropriate string value
>>> task3("hello world")
'odd'
>>> task3(1234)
'even'
>>> task3({1,1,2,3,4,5,2,3,4,5,6})
'even'
>>> task3(list(range(2,11)))
'odd'
>>> task3(tuple("cool"))
'even'

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!