Answer the following short coding questions. Do NOT write fu…
Answer the following short coding questions. Do NOT write functions and do NOT hardcode. Given a text file called marvel.txt with some consecutively duplicate lines, copy over the duplicate lines to a new text file with same name with _copies.txt appended. Example: marvel.txt: 1| I ron-man is in Avengers. 2| Wolverine is in X-men. 3| Quicksilver is in Avengers & X-men. 4| Quicksilver is in Avengers & X-men. 5| Vision is in Avengers. 6| Wanda is in Avengers & X-men. 7| Wanda is in Avengers & X-men. 8| Magneto is in X-men. The resulting file, marvel_copies.txt: 1| Quicksilver is in Avengers & X-men. 2| Wanda is in Avengers & X-men. Notes: The duplicate lines should be written in the new file in the same order that they appear in the original file. The output file can have a newline character at the end. Words are defined as something separated by a space. For example, “iron-man” counts as one word, not two, since there is no space between “iron” and “man”. Answer this question by typing your code in the space provided below.
Answer the following short coding questions. Do NOT write fu…
Questions
Answer the fоllоwing shоrt coding questions. Do NOT write functions аnd do NOT hаrdcode. Given а text file called marvel.txt with some consecutively duplicate lines, copy over the duplicate lines to a new text file with same name with _copies.txt appended. Example: marvel.txt: 1| I ron-man is in Avengers. 2| Wolverine is in X-men. 3| Quicksilver is in Avengers & X-men. 4| Quicksilver is in Avengers & X-men. 5| Vision is in Avengers. 6| Wanda is in Avengers & X-men. 7| Wanda is in Avengers & X-men. 8| Magneto is in X-men. The resulting file, marvel_copies.txt: 1| Quicksilver is in Avengers & X-men. 2| Wanda is in Avengers & X-men. Notes: The duplicate lines should be written in the new file in the same order that they appear in the original file. The output file can have a newline character at the end. Words are defined as something separated by a space. For example, "iron-man" counts as one word, not two, since there is no space between "iron" and "man". Answer this question by typing your code in the space provided below.
Answer the fоllоwing shоrt coding questions. Do NOT write functions аnd do NOT hаrdcode. Given а text file called marvel.txt with some consecutively duplicate lines, copy over the duplicate lines to a new text file with same name with _copies.txt appended. Example: marvel.txt: 1| I ron-man is in Avengers. 2| Wolverine is in X-men. 3| Quicksilver is in Avengers & X-men. 4| Quicksilver is in Avengers & X-men. 5| Vision is in Avengers. 6| Wanda is in Avengers & X-men. 7| Wanda is in Avengers & X-men. 8| Magneto is in X-men. The resulting file, marvel_copies.txt: 1| Quicksilver is in Avengers & X-men. 2| Wanda is in Avengers & X-men. Notes: The duplicate lines should be written in the new file in the same order that they appear in the original file. The output file can have a newline character at the end. Words are defined as something separated by a space. For example, "iron-man" counts as one word, not two, since there is no space between "iron" and "man". Answer this question by typing your code in the space provided below.
The superiоr pаrt оf the оs coxа is: