A new restriction was imposed on the entire cultural sector to ensure more social distancing1 between the letters of the alphabet. The result thereof can be seen from the text in this picture:
Can you figure out what restrictive measure was imposed and do you recognize the text? Click here to see the answer .
Write a function erase that takes two strings $$s$$ and $$t$$ (str) . The function must return string $$t$$ (str) in which all characters that occur in $$s$$ have been replaced by spaces. For each letter in $$s$$, both the uppercase and lowercase instances must be replaced.
Write a function discard that takes two arguments: i) a string $$s$$ (str) and the location (str) of a text file. The function also has a third optional parameter that may take the location (str) of a second text file. The function must write the content of the first text file (second argument) in which all characters that occur in $$s$$ have been replaced by spaces to the second text file (third argument). For each letter in $$s$$, both the uppercase and lowercase instances must be replaced. If no third argument is passed, the function must print the result after replacement.
Write a function isconsistent that takes the locations (str) of two text files. The function must return a Boolean value (bool) that indicates whether the two files are consistent. This is the case if:
both files have the same number of lines
all corresponding lines of both files have the same length
the two files have the same character at all corresponding positions where there is no space character in both files
In the following interactive session we assume the text files society.txt5 and bohemian.txt6 to be located in the current directory.
>>> erase('SOCIAL DISTANCING', 'We have a greed, with which we have agreed')
'We h ve ree , w h wh h we h ve ree '
>>> erase('SOCIALLY DISTANCED', 'We have a greed, with which we have agreed')
'W h v gr , w h wh h w h v gr '
>>> discard('SOCIAL DISTANCING', 'society.txt7')
h, ' my ery me
We h ve ree , w h wh h we h ve ree
y u h k y u h ve w m re h y u ee
U y u h ve y u w ' be free
e y, y u're r zy bree
h pe y u're e y w h u me
>>> discard('SOCIAL DISTANCING', 'society.txt8', 'society.01.txt9')
>>> discard('SOCIALLY DISTANCED', 'society.txt10', 'society.02.txt11')
>>> isconsistent('society.01.txt12', 'society.02.txt13')
True
>>> isconsistent('society.01.txt14', 'society.txt15')
True
>>> isconsistent('society.02.txt16', 'society.txt17')
True
>>> isconsistent('society.01.txt18', 'bohemian.txt19')
False
Ernest Hemingway published this "blank verse" in his high school literary magazine in 1916:
Get it? David Morice followed up with this "punctuation poem" in Word Ways20 in February 2012:
% , & —
+ . ? /
" :
% ;
+ $ [ \
It's a limerick21:
Percent comma ampersand dash
Plus period question mark slash
Quotation mark colon
Percent semicolon
Plus dollar sign bracket backslash