Skip to content

Commit

Permalink
Added word bytes in lesson
Browse files Browse the repository at this point in the history
  • Loading branch information
iantmn authored Sep 16, 2023
1 parent 8817f05 commit ef86e03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions content/lessons/code-this-not-that-python-edition/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ from sys import getsizeof

# Inefficent way 💩: Using a list ❌
L = [n for n in range(42_000)]
sum(L) # 881979000
sum(L) # 881979000 bytes
getsizeof(L) # 351064 bytes

# Efficient way 🔥: Use a generator ✅
Expand Down Expand Up @@ -264,4 +264,4 @@ f.close()
# Pythonic way 🐍 - Use a context manager ✅
with open("file.txt", "w") as f:
f.write("Hi mom!")
```
```

0 comments on commit ef86e03

Please sign in to comment.