Question: This assignment is about working with files and parsing data. You may choose the basic or challenge assignment. If you viewed the videos it should
This assignment is about working with files and parsing data. You may choose the basic or challenge assignment. If you viewed the videos it should not be difficult. Choose the basic or challenge assignment. Having the correct output is important here and will count for most of the points, Make sure to include comments in your code.
Download the txt file.
Download Download the txt file.
The file contains fictitious email addresses with the format username@schoolname.edu they are separated by commas.
Extract the username from the email address
Remove any leading spaces
Print them to the screen one per line. Make sure that you extract the username only
dlu@school.edu should look like dlu
There is not much code involved in doing this but you will need to use critical thinking.
Upload your py file. MAKE SURE TO INCLUDE YOUR INITIALS IN THE FILENAME
Challenge:
Parsing a large file
This is the complete text to Romeo and Juliet in a txt file
Download This is the complete text to Romeo and Juliet in a txt file
Actors lines are marked with Character. ex: Romeo. I am going
Choose a character and count how many times the character speaks
Go back and pick a random spot and extract a speech from that character.
Remove the character prompt so you just have the speech remove the Romeo, or Juliet.
Remove the punctuation from the speech
Open and print your results to a file: Your character, how many times they speak and one speech without punctuation
your choice of format Attach your output file in the comments. Include your initials in the filename.
Upload your py file as well.
Step 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
