Day 3 was all about text. If you want to build a chatbot, text is your primary material. You need to know how to clean it, parse it, match it, and store it so your program doesn't break every time someone types with weird capitalization.
1. Lists and Dictionaries for Chat Memory
We looked at two fundamental Python data structures: Lists (great for keeping an ordered log of messages) and Dictionaries (perfect for key-value pairs, like linking a keyword like 'pricing' to a canned answer). This is the foundation of every simple chatbot.
2. Cleaning Messy User Text
Real people type chaotically. They type in ALL CAPS, add three exclamation marks, or leave trailing spaces. We practiced methods like .lower(), .strip(), and substring checks ('if "help" in user_input'). Cleaning text first means your bot doesn't fail just because someone typed 'Hi' instead of 'hi'.
3. Sixty-Second Chatbot and the Whiteboard Session
For our lab task, Rashmi gave the cohort one hour to build a working terminal chatbot with multiple responses. I finished writing mine in about sixty seconds, so I spent the remaining time helping nearby classmates debug syntax errors. Seeing how fast I wrapped it up, Rashmi handed me a marker and asked me to go up to the whiteboard to teach file handling and while-loop structures to the class.
Standing at the whiteboard in front of the whole room was a cool challenge. I sketched out the loop logic and wrote out clean Python code. Rashmi helped adjust a few lines so the beginners could digest it easily. Teaching someone else is the ultimate test of whether you really understand your code.