Please answer in Python (no imports, no list comprehensions) Given a file with an encoded message and the parameter skip (as a positive integer), parse through it line by line and return a decoded version of the file in one string, with each decoded message in a new line. Don’t remove the extra empty line (last line) from the output string. Then, skip through lines based on the 'slip' parameter that will tell you how many lines to skip through as you parse through the file. Return the string with only the required information after 'skip'. while decoding, ignore: all exclamation points (!), question marks (?), semicolons (;), dollar signs ($) and any whitespaces. (example): if input has 6 lines and skip = 1, output will keep line 1, skip line 2, keep line 3, skip line 4, etc. If skip = 2 then output will keep line 1, skip lines 2 and 3, keep line 4, etc.
Please answer in Python (no imports, no list comprehensions)
Given a file with an encoded message and the parameter skip (as a positive integer), parse through it line by line and return a decoded version of the file in one string, with each decoded message in a new line. Don’t remove the extra empty line (last line) from the output string. Then, skip through lines based on the 'slip' parameter that will tell you how many lines to skip through as you parse through the file. Return the string with only the required information after 'skip'.
while decoding, ignore:
all exclamation points (!), question marks (?), semicolons (;), dollar signs ($) and any whitespaces.
(example): if input has 6 lines and skip = 1, output will keep line 1, skip line 2, keep line 3, skip line 4, etc. If skip = 2 then output will keep line 1, skip lines 2 and 3, keep line 4, etc.
Step by step
Solved in 2 steps with 2 images