Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SUBJECT PYTHON Before the next lesson, upload this lab to the learning hub at learn.bcit.ca in the /Activities/Assignments/Lesson9Lab dropbox. A sample solution will be posted

SUBJECT PYTHON Before the next lesson, upload this lab to the learning hub at learn.bcit.ca in the /Activities/Assignments/Lesson9Lab dropbox. A sample solution will be posted at the start of the next lesson, so late submissions are not accepted. Write a python script with the following four functions that use regular expressions created by you: Function name Returns True if the parameter matches this pattern isValidBCLicensePlate Six characters total: three letters then three digits, or three digits then three letters, or two letters, digit, space or hyphen, two digits, letter All letters are UPPERCASE Example matches: ABC123 123ABC AB1 23C AB1-23C isValidPythonVariable Name Between one and 32 characters total: all characters must be lowercase letters or underscores, but not more than one underscore in a row Example matches: first_name x a_good_variable_name isValidEmailAddress HINT: break down the parameter as follows: def isValidEmailAddress(email): email_data = re.split('@', email) username = email_data[0] domain_data = re.split('[.]', email_data[1]) domain_name = domain_data[0] top_level_domain = domain_data[1] Username followed by @ followed by domain name followed by period followed by top-level-domain. Username rules: letters (upper or lower case) and underscores (as long as _ is neither the first nor last character): between 1 and 256 characters total Domain name rules: letters (upper or lower case) between 1 and 32 characters total Top-level-domain rules: letters (upper or lower case) between 2 and 5 characters total. Example matches: Jason_Harrison@bcit.ca a_____b@c.com isValidHumanHeight Number of feet, apostrophe, number of inches, double quotation mark. The number of feet must be 2-8 inclusive. The number of inches must be 0-11 inclusive. The number of inches between 0 and 9 may have an optional leading zero (e.g. 508 or 58) The shortest height is 21 (not 20) and the tallest height is 811 Note: instead of double quotation marks for inches, you can accept the word in instead. Example matches: 201 21 509 62in 410in 62 811

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

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions

Question

2. Show the trainees how to do it without saying anything.

Answered: 1 week ago