You are on page 1of 4

Lab 6 SKR3305

29 November 2022

1. Do the following tasks and show your solutions to your demonstrator before the lab ends or
at the start of the next lab. For record-keeping, submit also your solutions and output
screenshots to PutraBlast. Your demonstrator will be evaluating your solutions.
2. Marks will be given according to the lab rubric ("SKR3305 Lab Rubric.docx") on PutraBlast.
3. You can do the lab tasks using cloud-based software such as Google Colab, or a local IDE such
as PyCharm or Visual Studio Code.

*******************************

Solve the Edabit (https://edabit.com/) problems on the next 3 pages using regular
expressions.
Problems:

1.

For easy copy-and-paste of examples:


is_valid_phone_number("(123) 456-7890") ➞ True

is_valid_phone_number("1111)555 2345") ➞ False

is_valid_phone_number("098) 123 4567") ➞ False


2.

For easy copy-and-paste of examples:


sub_reddit("https://www.reddit.com/r/funny/") ➞ "funny"

sub_reddit("https://www.reddit.com/r/relationships/") ➞ "relationships"

sub_reddit("https://www.reddit.com/r/mildlyinteresting/") ➞ "mildlyinteresting"
3.

For easy copy-and-paste of examples:


correct_signs("3 < 7 < 11") ➞ True

correct_signs("13 > 44 > 33 > 1") ➞ False

correct_signs("1 < 2 < 6 < 9 > 3") ➞ True

You might also like