Question: ( 3 5 ) Write a function binInvert ( ) . The function takes a string as its parameter. It should convert every occurrence of
Write a function binInvert The function takes a string as its parameter. It should convert every occurrence of to and every occurrence of to Then it should return the new string. You may assume that the string only contains s and s
Hint: Use the replace method.
You may test the function with this statement:
print binInvert
If the output is then your function is okay.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
