diff options
| author | mo khan <mo@mokhan.ca> | 2025-01-23 09:04:07 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-01-23 09:04:07 -0700 |
| commit | 329cb0e9e67ba0e894a3a1ab9b251d29294499b9 (patch) | |
| tree | 8801c036ded6b6e708bc24732123ac6f4ad5b5e0 | |
| parent | 7f03450427ceb527d7752d66dd3200a57e09a6b1 (diff) | |
Start assignment 4
| -rw-r--r-- | 3431709-assignment-4.pdf | bin | 77946 -> 104805 bytes | |||
| -rw-r--r-- | assignments/4-solution.md | 12 | ||||
| -rw-r--r-- | assignments/4/main.py | 9 |
3 files changed, 21 insertions, 0 deletions
diff --git a/3431709-assignment-4.pdf b/3431709-assignment-4.pdf Binary files differindex 36ac698..bd18b83 100644 --- a/3431709-assignment-4.pdf +++ b/3431709-assignment-4.pdf 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") |
