Coding
Workshop

Fall 2021
course
site
-->

Sep 14

projects

I've decided on specific deadlines for the 1 credit projects which I'll discuss briefly - see the projects page.

advent of code

Discuss what you've done so far ... and what I'd like you to do for the next two weeks; see the assignments page & the share/adventofcode pages.

You can work on these on your own or with a partner. I've posted code by me and a link to Peter Norvig's work. Please try to do these yourself first, then compare and consider other solutions. Submit and discuss your work on the homework page.

Please choose at least one part of one problem to share in the share/adventofcode/2017/you/ folder - anonymous or signed, up to you.

a few coding notes :

# reading in from a file
numbers = list(map(int, list(open("input.txt").read().strip())))  # file.txt has '123456....'
# ... and how to come up with expressions like that

regexes

And I'd like to practice some regexes during class.

Would it help for me to go over the basics?

See also data wrangling in MIT's "Missing Semester of Your CS Education" course.

So ... let's pick one to try, say from w3resource . Here's their answer .

Given a string like "https://foo.com/some/stuff/2020/09/29/more" , 
extract the date as a numeric tuple (2020, 9, 29), using 
python regular expressions.

I've uploaded the code that worked out in class for this one.

https://cs.bennington.college /courses /fall2021 /coding /notes /09-14
last modified Tue September 14 2021 5:05 pm

attachments [paper clip]

  last modified size
TXT get_date.py Tue Sep 14 2021 05:04 pm 726B