Update page 'Day 2 homework'

j
2023-06-07 03:10:42 +02:00
parent 096ce3ddb8
commit 620dbd2943
+3 -1
@@ -10,7 +10,7 @@
2. For each of the types string, bytestring, integer, floating point, and imaginary literals, construct a 5x5 table showing what happens when the character "0" or number 0 is compared to each other type. 2. For each of the types string, bytestring, integer, floating point, and imaginary literals, construct a 5x5 table showing what happens when the character "0" or number 0 is compared to each other type.
3. Now do the same thing for the + and == operators for each pair of types in two other 5x5 tables. 3. Now do the same thing for the + and == operators for each pair of types in two other 5x5 tables.
4. Write a small program that uses the AST module to open the lexer/parser example, and dumps the resulting AST. See if there are any arguments to the parse method which make the output easier to read. 4. Write a small program that uses the AST module to open the lexer/parser example, and dumps the resulting AST. See if there are any arguments to the parse method which make the output easier to read.
5. What does this do? `print("\007")` Can you figure out why? 5. What does this do? `print("\007")` Can you figure out why? [1]
6. What does this do? `print("abcdefg\rhijklmnop")` Can you figure out why? 6. What does this do? `print("abcdefg\rhijklmnop")` Can you figure out why?
7. This is an HTTP server. Run it and connect to http://localhost:8000 . Why doesn't this do the same thing as what you see above? (don't forget to shut down the HTTP server afterward.) 7. This is an HTTP server. Run it and connect to http://localhost:8000 . Why doesn't this do the same thing as what you see above? (don't forget to shut down the HTTP server afterward.)
@@ -57,4 +57,6 @@ except ValueError as err:
print("✅ test2 pass!") print("✅ test2 pass!")
``` ```
Footnotes:
[1] You have to turn on the setting `terminal.integrated.enableBell` in Visual Studio Code for the bell to work.