1. (10 points) Using string method find, extract the Video link from the following HTML code
for embedding videos on a web page. Your code should work for any embedded code of this
format.
<embed
src="http://www.youtube.com/v/Xp2uzv9uSn8?version=3&feature=pl
ayer_detailpage" type="application/x-shockwave-flash"
allowfullscreen="true" allowScriptAccess="always" width="640"
height="360">
2. (10 points) In the Disney cartoon adaptation of Lewis Carroll's "Alice's Adventures in
Wonderland," the Dormouse modifies a well known poem by substituting words. Define a
function dormouse that takes two arguments- a string representing a poem and a nested
sequence representing a dictionary. The function prints the poem that is generated from
replacing all words in the poem that appear in the dictionary with their translation. E.g.
poem = “twinkle twinkle little star how I wonder what you are”
dict = [(twinkle,twitter),(star,bat),(how,manner-inwhich),(
wonder,speculate)]
>>> dormouse(poem,dict)
twitter twitter little bat manner-in-which I speculate what you
are
poem = “humpty dumpty sat on a wall humpty dumpty had a great fall”
dict = [(humpty dumpty, the egg),(sat,rested-on-its
behind),(wall,bar),(great,gigantic),(fall,depreciation)]
>>>dormouse(poem,dict)
the egg rested-on-its-behind on a bar the egg had a gigantic
depreciation
3. (20 points) Write a function encrypt(msg) that takes any string, encrypts it using the “Route-
Rail Fence Cipher” and prints the encrypted string. The following link will be useful:
can anyone help me solve his