Question: Quick help! Python Tokenize Mask Write a function 'TokenizeMask(strParam)' that accepts a string as input and does the following: 1) replaces all spaces in it
Quick help! Python

Tokenize Mask Write a function 'TokenizeMask(strParam)' that accepts a string as input and does the following: 1) replaces all spaces in it with '_'; 2) replaces every fourth character with the string '[mask]'; 3) separates all characters with a space, except for those in the '[mask]' strings you added; and 4) returns the resultant string. For example, TokenizeMask("Research Square") should equal "R e s [mask] a r c [mask] _ S q [mask] a r e". Examples Input: "Research Square" Output: R e s [mask] a r c [mask] - 5 q [mask] a re Input: "abcdefghijk" Output: a b c [mask] e f g [mask] i j k
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
