From 00c819b157fb454a93fe9a57d9b0c4aa76ff7b32 Mon Sep 17 00:00:00 2001 From: "xuanyi.wang" Date: Fri, 31 Mar 2023 18:11:39 +0200 Subject: [PATCH] Update page 'Day 2 homework - Sloetjes' --- Day 2 homework - Sloetjes.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Day 2 homework - Sloetjes.md b/Day 2 homework - Sloetjes.md index 287db35..f77170c 100644 --- a/Day 2 homework - Sloetjes.md +++ b/Day 2 homework - Sloetjes.md @@ -34,9 +34,9 @@ The overall return value of each expression is the value assigned to the corresp | **0.0**| Not equal | Not equal | Equal | Equal | Not Equal | | **0j** | Not equal | Not equal | Equal | Not equal| Equal | -####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. -####The "+" operator case: +#### The "+" operator case: | | **'0'** | **b'0'** | **0** | **0.0**| **0j** | |---|---------|---------|---------|---------|---------| | **'0'** | '00' | TypeError | TypeError | TypeError | TypeError | @@ -45,7 +45,7 @@ The overall return value of each expression is the value assigned to the corresp | **0.0**| TypeError | TypeError | 0.0 | 0.0 | TypeError | | **0j** | TypeError | TypeError | 0j | TypeError| 0j | -####The "==" operator case: +#### The "==" operator case: | | **'0'** | **b'0'** | **0** | **0.0**| **0j** | |---|---------|---------|---------|---------|---------| @@ -55,7 +55,7 @@ The overall return value of each expression is the value assigned to the corresp | **0.0**| False | False | True | True| False | | **0j** | False | False | True | False| True | -####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. ``` import ast @@ -71,7 +71,7 @@ tree = ast.parse(source) print(ast.dump(tree, indent=4)) ``` -####5.What does this do? `print("\007")` Can you figure out why? +#### 5.What does this do? `print("\007")` Can you figure out why? The statement `print("\007")` prints **a bell character to the console**. The `“\007”` escape sequence represents **the ASCII code for the bell character**, which is also known as the alert or bell control character.