summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--3431709-assignment-4.pdfbin77946 -> 104805 bytes
-rw-r--r--assignments/4-solution.md12
-rw-r--r--assignments/4/main.py9
3 files changed, 21 insertions, 0 deletions
diff --git a/3431709-assignment-4.pdf b/3431709-assignment-4.pdf
index 36ac698..bd18b83 100644
--- a/3431709-assignment-4.pdf
+++ b/3431709-assignment-4.pdf
Binary files differ
diff --git a/assignments/4-solution.md b/assignments/4-solution.md
index 109042c..43c7781 100644
--- a/assignments/4-solution.md
+++ b/assignments/4-solution.md
@@ -7,6 +7,18 @@ There are no chapter end exercises for Chapter 9.
Chapter 10:
+> 9. In Python, indentation is used to indicate the extent of a block of code. What is the output of the following Python code?
+
+```python
+!include assignments/4/main.py
+```
+
+```bash
+$ python assignments/4/main.py
+second is bigger
+first is bigger
+```
+
Chapter 11:
Chapter 12:
diff --git a/assignments/4/main.py b/assignments/4/main.py
new file mode 100644
index 0000000..110e1a0
--- /dev/null
+++ b/assignments/4/main.py
@@ -0,0 +1,9 @@
+#!/usr/bin/env python
+
+first = 3
+second = 5
+if first < second:
+ print("second is bigger")
+else:
+ print("but this time ")
+print("first is bigger")