Question: please help asap. Language: Python ily sm thankyou in advance Congratulations! You have been hired as a new agent of SHEILD (security organization that defends

please help asap. Language: Python
ily sm thankyou in advance please help asap. Language: Pythonily sm thankyou in advance Congratulations! You have
been hired as a new agent of SHEILD (security organization that defends
Earth). The world is getting more and more superheroes and your first
task is to work on the database of superhero emails (even those
with telepathic powers need a traditional way to communicate). However, it appears

Congratulations! You have been hired as a new agent of SHEILD (security organization that defends Earth). The world is getting more and more superheroes and your first task is to work on the database of superhero emails (even those with telepathic powers need a traditional way to communicate). However, it appears that the evil forces are at work, the nefarious Doctor Octavious has hacked SHEILDs database and has entered in false emails. You must create a function that can correctly identify which emails are valid. A valid email at SHEILD has the following structure: Fill in the function problem1. This function should return the string valid if the input string is a valid email address and invalid if not. We define a valid email as follows: 1. The email must begin with the ID number of the hero, from 100 up to 799 (This is dictated by SHEILD's numbering rules) followed by a "," (period) 2. After the "." the email must have a name composed of upper or lower case letters, containing at least 1, but no more than 10 letters. 3. The email may have any amount of numbers following the letters of the name, but anything else between the name and the @ symbol is invalid 4. The email must have the "@" symbol followed by either "sheild.gov" or "avengers.com" 5. There must be nothing following the gov or .com Correct Examples: 123. iamironmanliavengers. com 258. Snogers1776tavengens, com 1ee. nickfuryesheild.gov 144, vencmeavengers, comasdf (broke rule 5) 942. byperiongavengers.con (breaks rule 1 , incorrect number in front) 567. greengoblingseild. gov (breaks rule 2 , too many letters) 324d rdocm324gavengers, con (breaks format established in 1 (does not have ", ) 765. Hosborn'876gshelid. gov (breaks rule 3, has sonething other than nunbers after nane and between "ge synbol) 234. vulturegshefld.com (breaks rule 4 , not correct ending) ANY other format should not count as a valid email. Spoces before or after an otherwise valid emall is considered imvalid Because we are looking for the entire string to be an emai, you can either use and s to force a match to be at the beginning and end of a string, or you can use fulimatch instead of match or search. Problem 2: Groups Wow, there are a lot of problems on your first day, the list of Heros and their vehicles have been lost. Luckily you have some transcripts that have the students and their ships. Fill in function problem 2 to return a tuple of the student's name and the spaceship that the student drives. A transcript would have the format Super Hero rides/flies a vehicle and will have the following conditions: 1. A Super Hero's name can be one word, or two words. The word or words in a name must start with a captial letter. 2. The verb can be either "rides" or "flies" 3. If the vehicle has a Name (first letter is capitalized), it can be two words. If the vehicle does not have a name, it will be one word and contain all lowercase letters. 4. If the above conditions are both not met, there is no match. You will then return a tuple of strings ("nohero", "noname") Example: The Wasp rides the wind, but Iron Man rides a quinjet Although there is the phrase "Wasp rides" it does not have "a" following the word "rides". Therefore, your program needs to keep looking for the correct pattern. This pattern is found in "Iron Man rides a Quinjet". The correct output of the problem2 would be ("Iron Man", Quinjet) Fill in the function problen2. This function should search an input string for the student and ship then return a tuple of them. Captain Anerica rides a Harley you should return: ('Captain Anerica', 'Harley') If you pass in: No one rides a Harley 11 ke Ghost Rider, athough Spider Man rides a Harley with sone similar expertise you should return: ("spider Nan", "Harley') This is because No one did not have a capitalized first letter in the word preceding "rides" If you pass in: Starlord flies many ships, but Rocket flies a Warbird special much faster you should return: ("rocket', 'Warbird special') This is because No one did not have a capitalized first letter in the word preceding "rides" If you pass in: starlord flies many ships, but Rocket flies a Warbird special much faster you should return: 'Warbird Special') vehicle has a 2 word name - both Warbird and Special are capitalized If you pass in: you should return: 'spaceship") vehicle does not have a name - returned volue is just one word and lowercase Be careful not to return extra spaces in the return value. You may need to do a little bit of extra processing of the string captured by your group to ensure this. You will receive partial credit for having spaces. Please remove extra spaces for full credit. Problem 3: Substitution Oh no! Someone has changed these audio transcripts from mission reports. You must correct the super hero namel Replace the word Boy/Girl or boy/girl with Man/Woman. Fill in the function problems to returns a string with the correct word restored. Here are the rules for replacement. Oh no! Someone has changed these audio transcripts from mission reports, You must correct the super hero name! Replace the word Boy/Girl or boy/girl with Man/Woman. Fill in the function problems to returns a string with the correct word restored. Here are the rules for replacement 1. Boy/Girl or boy/giri should be replaced with Man/Woman if the word prior to it is a name (starts with a captial letter) 2. If no match is found, return "nomatch" Here are some examples: spider Girl, I need helpl Should return Splder wonan, I need help! There is a boy trapped in a burning building Iron Boy Should return There is a boy trapped in a burning bullding Iron Man This is because the first boy is not proceeded by a word that has a Capital letter Be careful not to return extra spaces in the final output. You may need to do a little bit of extra processing of the string captured by your group to ensure this. You will receive partial credit for having unwanted spaces. Please remove extra spaces for full credit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!