My solutions to MIT 6.0001's problem sets in Python 3.9.
Video lectures for this course can be found on YouTube.
Disclaimer
These solutions were written and published solely for educational and self-study purposes and are not guaranteed to be correct. I highly encourage you to attempt solving these psets on your own before checking these solutions, and even so, take them with a grain of salt!
A note on broken helper code for pset 5
As of April 2023, the helper code provided on OCW's website for problem set 5 breaks when trying to run on Python 3.9. Some modifications had to be made to the original code in order to fix it.
Here are some of the issues I found and fixed:
- A deprecated
base64
decoding method in thefeedparser.py
module had to be removed. - The
process()
function inps5.py
broke when trying to access thedescription
property for RSS entries. Accessing thesummary
property instead fixes this. - The Yahoo News RSS feed endpoint (http://news.yahoo.com/rss/topstories) had to be removed in order avoid breaking the
process()
function. - Added more info to the exception handling to the
main_thread
inps5.py
using thetraceback
module.
With the changes above, the code now runs fine on Python 3.9 and displays news stories from the Google News RSS feed, using the triggers specified in the triggers.txt
file to filter stories.
6.0001 Introduction to Computer Science and Programming in Python is intended for students with little or no programming experience. It aims to provide students with an understanding of the role computation can play in solving problems and to help students, regardless of their major, feel justifiably confident of their ability to write small programs that allow them to accomplish useful goals. The class uses the Python 3.5 programming language.