0% found this document useful (0 votes)
48 views1 page

Descriptive Questions 3

This document contains 5 paragraphs describing different programming tasks. The tasks include using regular expressions to match strings starting with 4 and digits, parsing a URL from a BeautifulSoup object, setting up a DVWA server to test an XSRF attack, using PyInputPlus to validate user sandwich preferences, and developing a regular expression to match DNA gene sequences.

Uploaded by

Ujjwal Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views1 page

Descriptive Questions 3

This document contains 5 paragraphs describing different programming tasks. The tasks include using regular expressions to match strings starting with 4 and digits, parsing a URL from a BeautifulSoup object, setting up a DVWA server to test an XSRF attack, using PyInputPlus to validate user sandwich preferences, and developing a regular expression to match DNA gene sequences.

Uploaded by

Ujjwal Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

1.

Define the function “match_four” that takes a string and uses regex to return
True if the string starts with 4
followed by zero to many other digits and False if it does not.

2. Create a BeautifulSoup object named soup using the url https://umich.edu/. Using
BeautifulSoup,
print the URL that links to Current Students in the Navigation Bar.

3. Construct a DVWA setup to test the basic Cross Site Request Forgery (XSRF)
attack for changing the admin password to "exam123" and execute the DVWA with the
new password.

4. Write a program that asks users for their sandwich preferences. The program
should use PyInputPlus to ensure that they enter valid input, such as:
(a) Using inputMenu() for a bread type: wheat, white, or sourdough.
(b) Using inputYesNo() to ask if they want cheese.
(c) If so, using inputMenu() to ask for a cheese type: cheddar, Swiss,
or mozzarella.
(d) Using inputInt() to ask how many sandwiches they want. Make sure this
number is 1 or more.

5. DNA sequences are comprised of a simple 4-alphabet language with the symbols
{A,C,G,T}. Three consecutive letters are known as a codon, so ACT and TCG are both
codons. A Gene is a collection of at least three codons that starts with an ATG
codon and ends with a TAA, TAG, or TGA codon.
You need to develop a regular expression that will match strings that contain a
gene.

You might also like