Challenge 2: Let's work with lists, tuples and strings
We'll cover the following
Problem statement
Your task is to write a function, strManipulation(str)
, that takes a string as an argument.
There should be two functions in the strManipulation()
function.
- Write a
capitalize_listElements(str)
function that capitalizes each word’s first alphabet present in the string and convertsstr
tolist
. It should then count the total number of lower and upper case letters present in the list and return theupdatedList
,lCount
, anduCount
. - Write another function,
findOccurance(list)
, that will first convert theupdatedList
to a tuple and then find the most common element of the tuple and return that element.
Note: The
strManipulation(str)
function will returnupdatedList
,lCount
,uCount
,convertedTuple
, andoccurElem
.
Get hands-on with 1400+ tech skills courses.