Skip to content

Commit 48e15b8

Browse files
committed
Fix index to list when there is no 2nd element
1 parent e7d9b8d commit 48e15b8

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

Chapter4_TheGreatestTheoremNeverTold/top_pic_comments.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
top_submissions = subreddit.get_top()
1313

1414

15-
n_pic = int( sys.argv[1] ) if sys.argv[1] else 1
15+
n_pic = int( sys.argv[1] ) if len(sys.argv) > 1 else 1
1616

1717
i = 0
1818
while i < n_pic:
@@ -39,25 +39,25 @@
3939
contents.append( comment.body )
4040
except Exception as e:
4141
continue
42-
42+
4343
votes = np.array( [ upvotes, downvotes] ).T
4444

4545

4646

4747

48-
49-
50-
51-
52-
53-
54-
55-
56-
57-
58-
59-
60-
6148

62-
49+
50+
51+
52+
53+
54+
55+
56+
57+
58+
59+
60+
61+
62+
6363

0 commit comments

Comments
 (0)