Bit about Bytes: Understanding Python Bytecode
I hereby solicit suggestions for the video of the day. Please email me your ideas with explanations. Selected entries will win 5 homework points. If your video is played at the beginning of class, you must also briefly explain something about the video and something about yourself - in person.
x = [True, True, False] any(x) and not all(x)What is the output of the above code?
https://pollev.com/slade You may also download the app to your phone. Use the "slade" poll id.
time.time() → floatReturn the time in seconds since the epoch as a floating point number. The handling of leap seconds is platform dependent. On Windows and most Unix systems, the leap seconds are not counted towards the time in seconds since the epoch. This is commonly referred to as Unix time.
The second midterm will similar to the first. You will have 2 hours. Here is a sample midterm exam. (solutions) There will also be a question on data structures.
There will be a UNIX question, as in the first midterm. Here is a sample UNIX transcript (solutions) UNIX will cover through principle 3.
The current version of Python, 3.11, generates some new byte codes that were not part of previous versions. I have added definitions for these op codes to hw5.py. See dis.html which includes bytecodes new in 3.11.