Skip to content

Commit d4ea273

Browse files
committed
resubmitting lab08_v2
1 parent e091dee commit d4ea273

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

code/jonpan/lab08_v2.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,19 @@
1414

1515
# pprint.pprint(data)
1616

17-
x = random.choice(range(len(data)))
18-
joke = data['results'][x]['joke']
19-
20-
print(joke)
21-
17+
# x = random.choice(range(len(data)))
18+
# joke = data['results'][x]['joke']
19+
# print(joke)
20+
21+
while True:
22+
x = random.choice(range(len(data)))
23+
joke = data['results'][x]['joke']
24+
print(joke)
25+
more = input("do you want another joke? yes or no. ")
26+
if more == "no":
27+
print("see you later")
28+
break
29+
2230

2331
# for i in range(len(data)):
2432
# print(random.choice(data['results'][i]['joke']))

0 commit comments

Comments
 (0)