I've decided on specific deadlines for the 1 credit projects which I'll discuss briefly - see the projects page.
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
sum(numbers)
built in ...[f(x) for x in some_sequence]
can be powerfulAnd 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.
last modified | size | ||
get_date.py | Tue Sep 14 2021 05:04 pm | 726B |