Question: 7 Question 6 4 pts Write a function called mystrip(chars, option) to return a copy of string chars with leading and/or trailing whitespace removed. The
7
Question 6 4 pts Write a function called mystrip(chars, option) to return a copy of string chars with leading and/or trailing whitespace removed. The input argument option is a keyword (or keyworded) argument with a default value "both". When option = "left", remove the leading whitespace; when option = "right", remove the trailing whitespace; when option = "both", remove both leading and trailing whitespaces. (Python built-in functions are allowed. Define the function only without calling it.) Edit View Insert Format Tools Table 12pt v Paragraph " B I U A v Z v TV Q B Q DVR 6 8 VEEV DB VG def mystrip(chars, option="both"): if option = = "left": eturn chars.Istrip() elif option = = "right": return chars.rstrip() elif option == "both": return chars.strip() else: FREE 1 33 wordsStep 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
