Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 returnStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started