Skip to content

Commit bbf82d6

Browse files
authored
Add files via upload
1 parent f711e2b commit bbf82d6

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

Random Chatbot.ipynb

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "175e33f7",
6+
"metadata": {},
7+
"source": [
8+
"# Multiple Inputs with Python using While Loop\n",
9+
"### enter stop to end the chat"
10+
]
11+
},
12+
{
13+
"cell_type": "code",
14+
"execution_count": 3,
15+
"id": "b3e3184b",
16+
"metadata": {},
17+
"outputs": [
18+
{
19+
"name": "stdout",
20+
"output_type": "stream",
21+
"text": [
22+
"Enter Text: hi\n",
23+
"Sara is swimming in the pool\n",
24+
"Enter Text: I am waiting\n",
25+
"You are tall\n",
26+
"Enter Text: no\n",
27+
"I am not watching TV now\n",
28+
"Enter Text: stop\n"
29+
]
30+
}
31+
],
32+
"source": [
33+
"import random \n",
34+
"while True:\n",
35+
" s = ['My sister wants to eat apples', 'Sara is swimming in the ocean', 'I am not watching TV now', 'They are happy', 'He wants to buy some things', 'She is playing hockey', 'The children are playing in the park', 'Sara is swimming in the pool', 'You are working on this job for 5 years', 'John is sleeping in the bed', 'We drink water', 'She is a pretty girl', 'He is watching TV all day long', 'They are working on this job for 5 years', 'We will make a glass of lemon juice', 'She is not hungry yet', 'He is not watching TV all day long', 'I cannot go to the party tomorrow', 'I will meet you tomorrow at ten o’clock', 'Joe is a good boy', 'I will help my sister', 'You are not skiing yet', 'You are tall', 'They are sleeping on the couch', 'Sara is playing badminton', 'The man is sleeping on the couch', 'I am not sleeping yet', 'I am not working yet', 'I want to drink water', 'It is raining', 'I want to buy some things']\n",
36+
" reply = input(\"Enter Text: \")\n",
37+
" if reply == 'stop': break\n",
38+
" print (random.choice(s))"
39+
]
40+
}
41+
],
42+
"metadata": {
43+
"kernelspec": {
44+
"display_name": "Python 3 (ipykernel)",
45+
"language": "python",
46+
"name": "python3"
47+
},
48+
"language_info": {
49+
"codemirror_mode": {
50+
"name": "ipython",
51+
"version": 3
52+
},
53+
"file_extension": ".py",
54+
"mimetype": "text/x-python",
55+
"name": "python",
56+
"nbconvert_exporter": "python",
57+
"pygments_lexer": "ipython3",
58+
"version": "3.9.7"
59+
}
60+
},
61+
"nbformat": 4,
62+
"nbformat_minor": 5
63+
}

0 commit comments

Comments
 (0)