Python: list comprehensions from Socratica (fixed)
https://pollev.com/slade You may also download the app to your phone. Use the "slade" poll id.
Click for today's quiz. Note: to reward attendance, in-class quizzes are now worth 5 homework points.
There are hundreds of Python modules. Going forward, I invite students to present their own selected Python module of the day, along with some sample code. Send me an email. Students whose submissions are selected will present their modules in class and earn 5 extra homework points.
In 2022, the New Yorker ran the above cartoon. At first, I thought it referred to our exams.
The midterm will be Thursday February 26th at 7pm in DL 316. It will be a 2 hour hand written exam. No computers. No notes. No books. No kidding. Students registered with Student Accessbility Services will take the exam in room KT 219.
Here is a practice exam. (solutions). Practice UNIX script. (UPDATED) (solutions). mt.py code for practice midterm
Here is a great resource to practice regular expressions https://regex101.com/ Also, see www.regular-expressions.info which has a tutorial as well as useful examples, including HTML tags, email addresss, IP addresses, dates, credit cards, and lots more.
Also, check out Regular Expression Crosswords
Also, the paper Music and Computation, discussed below, is also in scope, up to but not including Music. There will be true/false questions about binary encodings of numbers, text, images, and sound. No questions about music.
I asked AI for sample questions. See truefalse.a.txt and truefalse.b.txt.
Sophia held a review session. Friday February 20th, 2-5pm., DL 316 (same as exam room).
Python idioms:
a, b = b, a
s[::-1]
s == s[::-1]
Math.prod(range(1,n+1))
[i for sub in lst for i in sub]
[x for x in range(10) if x % 2 == 0]
{**d1, **d2}
from collections import Counter Counter(lst)
set(lst)
''.join(str)
Review hw3. configurations.