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

Breaking Free from Chemical Rockets

Welcome back to my blog! This post is for the second Action Project of the STEAM class, Frontiers. This class has been about the frontiers of science and discovery in space and the oceans. We studied marine ecology, biology, geology, and physiology in the first unit. We also looked at technological frontiers in the maritime sector, such as ways to clean up ocean pollution, capture carbon dioxide, and rebuild coral reefs. In this unit, we have looked at the stars, planets, and galaxies around us. We have learned about how the universe came to exist and how humans began to study it. For this Action Project, we have been tasked with writing a research paper about a frontier of our choosing in the field of space exploration. For my paper, I decided to look into propulsion systems or the types of rockets that can bring humans or crewless spacecraft from the Earth's surface into orbit. Propulsion systems have been researched and built for many years, so in a general sense, they aren'

Food, a Human Right?

In our Humanities or SDGs class, Sustainable Development Goals, we were talking about the certain goals that could be thought of as a need to be a human right. The options were no poverty, no hunger, and quality education. The goal that I chose was number two, no hunger. I believe that food should be a human right because it is primarily a basic need. We need food to survive and if we do not have it we will obviously die, since that is the only alternative. Before then we went on a field experience to Lincoln Park Community Services in Chicago. There we experienced people who are hungry and we also as a class, cooked for the people that attended the lunch. I personally enjoyed this because I was able to talk with people that needed food and they were really appreciative of the food that they had been given. This led to the action project which is an essay about our chosen goal. The essay is below. To, Hiu, LPCS 2019, One of the food items cooked was chicken. Could you imagine

Opposing Opinions

Welcome to my blog. This is the first Action Project for the winter term class Forbidden Books. In this unit we read the book, Fahrenheit 451  by Ray Bradbury. This book was banned because of its description of burning literature, mentioning abortions, suicide, murder, and drugs. In many schools this book has been prohibited from the curriculum due to its story. After reading this book myself I can understand why some schools or people would not want children to read it. We have also observed other censored books such as Green Eggs and Ham  by Dr. Seuss. In these short assignments we tried finding why people would censor these children's books. In this unit we talked about Socrates and his suicide as a result of being charged for corrupting the youth in the teachings he believed and followed. For this Action Project we had to create a Socratic Dialogue about any topic. During Socrates' trial he questioned his accuser, Meletus. Socrates tried getting Meletus to come to a realiza