Question: Please REPLACE ??? with the SOLUTION TO FIX THE CODE in PYTHON #### REPLACE all ??? with the solution/fix ### 1 ### # This is
Please REPLACE ??? with the SOLUTION TO FIX THE CODE in PYTHON

#### REPLACE all ??? with the solution/fix ### 1 ### # This is broken...please fix me! # # declare function name, accept one argument def countCharactersInAstring(words) : # we'll have to initialize the variable to o (we'll need something to 'store' the count later) count = 0 #let's perform the loop here, extracting a character from each part of the words argument for ??? in words: #use flow/control logic if len(chars) != 0: #increment the counter count = ??? + 1 #return the result return ??? countCharactersInAstring("hats are cool") #13 ### 2 ### # Is it still broken, oh, it's changed... # # declare function name, accept one argument def reverseCharactersInAstring(words): # we'll have to initialize the variable to store a new string, hence the empty string newwords=??? #let's perform the loop here, extracting a character from each part of the words argument for chars in words: #use flow/control logic if len(chars) != ???: #append the characters now naturally reversed to the original variable newWords = chars+newWords #return the result return
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
