Question: import requests, re, json from pprint import pprint from bs4 import BeautifulSoup def shakespeare_position(role, section): section_1 = 'Benvolio: By my head, here come the Capulets.
import requests, re, json from pprint import pprint from bs4 import BeautifulSoup
def shakespeare_position(role, section):
section_1 = 'Benvolio: By my head, here come the Capulets. Mercutio: By my heel, I care not. ' + \ 'Tybalt: Gentlemen, good den: a word with one of you. Mercutio: And but one word with one of us?' pprint(shakespeare_position('Tybalt', section_1)) pprint(shakespeare_position('Mercutio', section_1))
write a python code that returns those exact outputs using regex, show your output please.
''' >>> shakespeare_position('Tybalt', section_1) 'By my heel, I care not.' >>> shakespeare_position('Mercutio', section_1) 'By my head, here come the Capulets.' '''
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
