Update README.md
Browse files
README.md
CHANGED
@@ -1,8 +1,29 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import random
|
2 |
+
|
3 |
+
# List of "Deez Nuts" jokes
|
4 |
+
jokes = [
|
5 |
+
"Hey, have you heard about the new company that sells nuts? It's called 'Deez Nuts'.",
|
6 |
+
"Do you know what time it is? It's 'Deez Nuts' o'clock!",
|
7 |
+
"What did the squirrel say when he saw the new store? 'Deez Nuts!'",
|
8 |
+
"Why did the peanut go to the doctor? Because it had 'Deez Nuts' disease!",
|
9 |
+
"What did the farmer say when he lost his nuts? 'I guess I need some 'Deez Nuts'!'"
|
10 |
+
]
|
11 |
+
|
12 |
+
def get_joke():
|
13 |
+
return random.choice(jokes)
|
14 |
+
|
15 |
+
def chatbot():
|
16 |
+
print("Hello! I'm your Deez Nuts joke bot. Type 'joke' to hear a joke or 'quit' to exit.")
|
17 |
+
|
18 |
+
while True:
|
19 |
+
user_input = input("> ").strip().lower()
|
20 |
+
if user_input == 'joke':
|
21 |
+
print(get_joke())
|
22 |
+
elif user_input == 'quit':
|
23 |
+
print("Goodbye! Hope you enjoyed the jokes!")
|
24 |
+
break
|
25 |
+
else:
|
26 |
+
print("I don't understand that command. Type 'joke' to hear a joke or 'quit' to exit.")
|
27 |
+
|
28 |
+
if __name__ == "__main__":
|
29 |
+
chatbot()
|