Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

#### 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago