ew Tools Education 10. Impleme.. Terminal func.py x test.py func.py name.py Collapse E2: Writing an If-Else-Statement A function to extract names from e-mail addresses. W N 10. Implement the Function 4 Author: Mobolaji Ogunrinde Read the specification for the function and look at the test cases in the Date: 109/30/2021 6 provided test script. With this information, complete the function, making 7 import introcs sure to use an if-else statement. As there are only two possible types of e- 8 mail addresses, it should be pretty straightforward to figure out how to 9 do this. 10 def extract_name (s) : 11 The harder part is figuring out how to extract the name. This obviously 12 Returns the first name of the person in e-mail address involves string slicing, but you need to know where to slice. There are 13 functions in the introcs| module that can help you here. 14 We assume (see the precondition below) that the e-mail 15 v two forms : When you have implemented the function, run the test script. If you have 16 done it correctly, you should pass all tests. 17 last. first@megacorp. com Check the Function 18 First. last@mompop . net You may run this test multiple times. 19 20 where first and last correspond to the person's first Check It! 21 are not empty, and contain only letters. Everything af 22 to be exactly as shown. AST RUN on 9/30/2021, 7:40:19 PM 23 24 The function preserves the capitalization of the e-mai The call extract_name( ' smith. john@megacorp. com' ) returns None, 25 not ' john' . 26 Examples : 27 extract_name ( ' smith . john@megacorp. com' ) returns 'j 28 extract_name ( ' maggie . white@mompop . net' ) returns 'm 29 extract_name ( ' Bob . Bird@mompop. net' ) returns 'Bob' 30 Next 31 Parameter s: The e-mail address to extract from 32 Precondition: s is in one of the two address formats d 33 34 # You must use an if-else statement in this function. 35 36 first_name = 37 AK 0% (1:0) Python MacBook Pro