Skip to main content

Making a Chatbot Using Python

 Hello and welcome back to the exciting coding post. In the class, Computer Science we have continued to code using python. This unit relates to the last unit and post that was made about Inputs. There I made a calculator and a form letter that can function when the user types in inputs that respond to some of the computer's questions. For this unit we have made a chatbot that will take inputs but also respond to the user. Chatbots are used on many different websites. There are some that are solely dedicated to having a computer talk to you based on your questions and answers. Some websites where it asks if you want to speak to a worker or other person use a chatbot to answer the user and direct them to a worker. In this piece of code I included some questions, a random response generator, and a few other modules and functions. If you would like to try the chatbot out for yourself you can. All you need to do is answer the questions it gives you on the right side of the code box. 



That is the last coding project of the term. I hope they were easy to understand and manage. I liked working on this chatbot. Taking the code piece by piece was interesting and when it all came together and worked it was better. Although I had some minor struggle with the coding I was able to continue working on it and eventually finish. The if/elif/else statements are fun to assemble. They can use input and print functions and they are good with creating chatbots. Of course this code that I made can be larger. With more questions and answers to give the chatbot can be better. There are also some ways that the code can look cleaner by adding a few functions to them. If you want to make a chatbot of your own it works how mine does and you can create many different questions that are asked or even show something else like a photo. Thank you for reading through this blog post and exploring the chatbot if you did. This project was pretty fun and I am excited to see what else I can code in the future.

Comments

Popular posts from this blog

Input Manipulation Using Python

Welcome back to my blog. This post is for the projects in the Computer Science class. In Computer Science we have been learning about different types of coding and how computers work. We have done math problems in binary code and practiced making something from using python. In these two projects we used python to code a advanced calculator that you can use to find what the temperature in Celsius is based off of your input of your temperature outside in Fahrenheit. The second project here is a code that uses your inputs to create a letter to a state representative to talk about something important to you. Both of these codes have been checked multiple times to see if there were any errors or changes that needed to be made. If you would like to try them out for yourself you can do so by typing in your responses on the right to the questions that are asked. The first project is an advanced calculator that takes an input of a given temperature in Fahrenheit and converts it into Celsius fo...

I Am a Peacebuilder

This post is for the Civic Term class Global Peace. In the three weeks of this class we covered sarvodaya, satyagraha, and Sharpe's 198 Nonviolent Methods of Nonviolence. Sarvodaya and satyagraha were concepts by Gandhi. Sarvodaya explains that all are rising and is supposed to be an answer to all "isms" such as capitalism or communism. The large list of nonviolent methods consists of speeches, marches, strikes, physical interventions, peaceful noncooperation, boycotts, and more. For this project I chose to focus on homelessness in Chicago. In the large city you can find tent cities or people camped on the street in many places. With the weather in Chicago living outside with only a small shelter or none at all can be difficult for surviving. The city is also dotted with empty lots or abandoned land. I believe these plots of land can be redesigned into housing for the homeless. Each person or group of persons depending on their situation would have a small residence where...

The USS Hermit, A Ship to the Future

Hello, this is my Action Project for the class Redesign the Future. In this class we have covered climate change, Bill Gates' 5 Grand Challenges to tackling climate change, circular economy, systems thinking, and some of the Sustainable Development Goals. In this unit we went to The Plant Chicago where we learned about aquaponics, The Hive which talked about bees and their struggle against climate change, Friends of the Chicago River that taught us about our river and its history, Rheaply which showed us their company and an insider view of circular economy, and the Lincoln Park Zoo which told us about select ecosystems and habitats for their animals of all kinds. This unit went very in depth on the concept of systems thinking. We talked about certain actions that were made to solve problems such as the malaria in Borneo but the unintended consequences that followed and how to solve them. This AP is about a design that follows one of the 5 grand challenges and also how can you solv...