Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Python Exercise 8.15 Exercises 315 e 12 (Project: Scrambled Text) Use string processing capabilities to keep the first and last letter of a word

In Python
Exercise 8.15 image text in transcribed
Exercises 315 e 12 (Project: Scrambled Text) Use string processing capabilities to keep the first and last letter of a word and scramble the remaining letters in between the first and last Search online for University of Cambridge scrambled text for an intriguing paper on the read- ability of texts consisting of such scrambled words. Investigate the random module's shuf- the function to help you implement this exercise's solution. Regular Expression Exercises 8.13 (Regular Expressions: Condense Spaces to a Single Space) Check whether a sen- rence contains more than one space between words. If so, remove the extra spaces and dis- play the results. For example, 'Hello World' should become 'Hello World'. 8.14 (Regular Expressions: Capturing Substrings) Reimplement Exercises 8.5 and 8.6 using regular expressions that capture the matching substrings, then display them. 8.15 (Regular Expressions: Counting Characters and Words) Use regular expressions and the findall function to count the number of digits, non-digit characters, whitespace characters and words in a string. 8.16 (Regular Expressions: Locating URL) Use a regular expression to search through a string and to locate all valid URLs. For this exercise, assume that a valid URL has the form http://www.domain_name.extension, where extension must be two or more characters. 8.17 (Regular Expressions: Matching Numeric Values) Write a regular expression that searches a string and matches a valid number. A number can have any number of digits, but it can have only digits and a decimal point and possibly a leading sign. The decimal point is optional, but if it appears in the number, there must be only one, and it must have digits on its left and its right. There should be whitespace or a beginning or end-of-line character on either side of a valid number. 8.18 (Regular Expression: Password Format Validator) Search online for secure pass- word recommendations, then research existing regular expressions that validate secure passwords. Two examples of password requirements are: Passwords must contain at least five words, each separated by a hyphen, a space, a period, a comma or an underscore. Passwords must have a minimum of 8 characters and contain at least one each from uppercase characters, lowercase characters, digits and punctuation charac- ters (such as characters in '!@#$%&*?"). Write regular expressions for each of the two requirements above, then use them to test sample passwords. 3.19 (Regular Expressions: Testing Regular Expressions Online) Before using any regu- lar expression in your code, you should thoroughly test it to ensure that it meets your needs. Use a regular expression website like regex 101.com to explore and test existing reg- war expressions, then write your own regular expression tester. 6:20 (Regular Expressions: Munging Dates) Dates are stored and displayed in several Common formats. Three common formats are 042555 04/25/1955 April 25, 1955

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Students also viewed these Databases questions

Question

(2) Determining the general form of the model.

Answered: 1 week ago