CS 2000 - Fall 2025.


[Home]

Welcome to CS 2000! 9/17/2025

Video of the Day

Python: list comprehensions from Socratica (fixed)

Python: lambda expressions from Socratica

Logical problem of the day

There are two brothers. They were born on the same year, the same month, and the same day to the same parents. However, they are not twins. Explain.

https://pollev.com/slade You may also download the app to your phone. Use the "slade" poll id.

Canvas Quiz of the Day (need daily password)

Most days, there will be a simple canvas quiz related to the lecture. You need a password to activate the quiz, which I will provide in class. These quizzes will count toward your class participation grade. The quiz is available only during class.

Click for today's quiz.

Note: the collaboration quiz is separate. It coincides with the first homework assignment.

Lecture 6: Python.

Administrivia

  • I have office hours Wednesdays from 4-6 pm, on zoom, id 459 434 2854.

  • Starting this week, I will be available for lunch on Mondays at 1 pm in Morse.

  • ULA office hours are found at Ed Discussions on Canvas. Note that Christian Choi is our newest ULA.

  • CS Peer Advisers. Fall 2025 Peer Advisors Office Hours Schedule.

  • Homework assignments: [Assignments]. hw2 is now available.

    Announcements

  • Yale Information Society Project See this week's events.

  • The Yale Computer Society (y/cs) is hosting a cybersecurity panel ( The Danger of "Deploy") this Thursday 6:30-7:30pm at Tsai City with Dr. Timothy Barron, Tyler Schroder '25, Alex Schapiro '26, and Eric Yoon '27. RSVP. Become a y/cs General Member at yalecomputersociety.org/join!

  • Office of Career Services STEMConnect Pop Up advising Fall schedule. Drop in to one and have your resume reviewed, hear advice about finding internships, and learn more about how to get connected to alumni for networking opportunities.

    Getting to know Python

  • hw1.py review. power_set()

  • Google foobar challenge

  • list comprehension implementations. See Hello, where is the source code of list comprehension of Python? (We will discuss the Python Virtual Machine for interpretting byte code. We will actually implement the PVM for a subset of Python.)

  • map + enumerate
    ranked_users = ['jon','bob','jane','alice','chris']
    user_details = map(lambda i,x: {'name':x, 'rank':i}, enumerate(ranked_users)) ## error
    user_details2 = [{'name':x, 'rank':i} for i,x in enumerate(ranked_users)] 
          

  • Also, see zip
    ranked_users = ['jon','bob','jane','alice','chris']
    zipusers = zip(range(1,6),ranked_users)
    zuser_details = map(lambda i,x: {'name':x, 'rank':i}, range(1,6), ranked_users)
    zuser_details2 = [{'name':x, 'rank':i} for i,x in zipusers] 
          

    MapReduce and Hadoop HDFS = Hadoop Distributed File System.

  • Sorting.html (jupyter) Python - Sorting

  • DictFiles.html (jupyter) Python - Dicts and Files

  • RegExp.html (jupyter) Python - Regular Expressions

  • Utilities.html (jupyter) Python - Utilities

  • Requests.html (jupyter) Python - Requests - a better way to process web pages, plus Beautiful Soup.

    Everything is bits!

    See Music and Computation.

    Getting to know UNIX

    UNIX Introduction Principle 2. (+ head, cat, JCL, punchcards)
    [Home]