-
Notifications
You must be signed in to change notification settings - Fork 34
Homework 1
Jinho D. Choi edited this page Jan 29, 2018
·
11 revisions
Download hw1.py
.
Write regular expressions in Python matching the following cases (one expression per case):
- Phone numbers (e.g., +1(800) 123-4567)
- Dates (e.g., March 1, 2018)
- Emoticons (e.g., :-), :P)
Use the template in hw1.py
for your expressions:
RE_PHONE_NUMBER = re.compile('your expression')
RE_DATE = re.compile('your expression')
RE_EMOTICON = re.compile('your expression')
Try to cover as many patterns as possible. Be aware that these cases can occur anywhere in a document. In the report, briefly explain what kind of groups you make in your expressions.
Normalize numbers in various formats into digits:
- One million five thousands twenty four →
1005024
. - 2 hundreds two →
202
.
Complete the norm_number
function in hw1.py
:
Your task is to implement a program that takes a list of course numbers (e.g., QTM385-1, CS323-1) and returns their final exam schedule sorted by data and time.
Copyright © 2018 Emory University - All Rights Reserved.