Skip to content

Commit 1fa0619

Browse files
committed
removed random_digits as it's unneeded
1 parent f056043 commit 1fa0619

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

joke.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
from random import *
44

55

6-
def random_digits(joke_count):
7-
# Return a joke index between first and last joke in data
8-
return randint(1, joke_count)
9-
106
def get_joke():
117
# Return random joke
128
with open('data.json') as data_file:
139
data = json.load(data_file)
14-
joke = data[random_digits(len(data))]
15-
print joke
10+
joke = data[randint(1, len(data))]
1611
return joke

0 commit comments

Comments
 (0)