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

Building GCE's New Laser Cutter

Welcome back to my blog. This post is for my elective class Digital Fabrication. In this class, we have been looking at all things digital. More specifically 3D printers, silhouette cutters, CNC routers, and laser cutters. 3D printers are machines that can create three-dimensional objects from CAD models by layering filament to create shapes. Silhouette cutters are small electronic cutting machines that can take a file on a computer and cut it out on vinyl, acrylic, paper, and more. I have used the cutter to create stickers on vinyl. The CNC router we used in this class was a machine called the Carvey. The Carvey uses a drill bit mounted on an operating system like a 3D printer to drill into wood, foam, and other materials to create designs or molds. For each of these machines, we learned how to use their programs and later work with the machines to create things we made on the programs.  Last but definitely not least, laser cutters. A laser cutter is a machine similar to the Carve...

Redesigning Chicago, One Neighborhood At A Time

Welcome back to my blog. This post is for the third Action Project of the STEAM class Urban Planning. In this third and final unit, Flow, we focused on how cities and urban areas have developed over the years. We first learned about how cities have always been centered around trade which has always relied on transportation and studied different modes of travel over the years that all contribute to urban planning. We took some time to learn about eminent domain which is something the state can use to claim private land from a private citizen for its own use if it has a strong case such as public use. We then looked at INVEST South/West, Chicago Mayor Lori Lightfoot's community development initiative to reverse disinvestment on Chicago's South and West Sides. This initiative is trying to bring together multiple city departments, community organizations, and corporate partners and so far the city has aligned more than $1.4 billion in public and private investment. We then moved on...

United States Refugees: What must they go through?

Welcome back to my blog. This post is for the workshop class, The War on X. The War on X is a new elective class at GCE this Fall term that focuses on current events that their own small battles and large levels of importance. Some topics that were up for discussion were the War on Afghanistan, the War on Immigration, and Critical Race Theory. For this first unit the majority of the class decided to talk about the War on Immigration. More specifically we focused on the United States-Mexico border and the situation there. We looked into the history of a border and eventually wall being at the border in the first place and moved on to examine more recent events from the presidency of Donald Trump. We also looked at the entry process for immigrants, asylum seekers, and refugees to enter the United States. In this small Action Project we were asked to choose one of the three groups trying to enter the US and look at their entrance process further. I chose to study refugees more because the...