Skip to content

Commit 836eab7

Browse files
authored
Merge pull request #242 from Gattocrucco/alt-sol-4
Alternative solution to exercise 4
2 parents 521b1c0 + 8ea76d1 commit 836eab7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

source/exercises100.ktx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ hint: size, itemsize
3737
Z = np.zeros((10,10))
3838
print("%d bytes" % (Z.size * Z.itemsize))
3939

40+
# Simpler alternative
41+
print("%d bytes" % Z.nbytes)
42+
4043
< q5
4144
How to get the documentation of the numpy add function from the command line? (★☆☆)
4245

0 commit comments

Comments
 (0)