đź§ Chatbot with Python
A simple and interactive Python chatbot that demonstrates basic programming concepts such as variables, loops, conditionals, functions, and user input. This chatbot engages users in a friendly conversation — greeting them, asking for their name, guessing their age using modular arithmetic, counting numbers, and testing programming knowledge with a small quiz.
🚀 Features
đź’¬ Friendly interaction: Greets the user and remembers their name.
🧮 Age guessing: Uses math (remainders with 3, 5, and 7) to calculate the user’s age.
🔢 Counting demo: Counts up to any number the user provides.
🧩 Programming quiz: Tests the user’s understanding of programming concepts.
âś… Error handling: Handles invalid inputs gracefully.
🖥️ Command-line interface: Simple to run and requires only Python.
🛠️ How It Works
The chatbot performs a series of steps:
Greets the user with its name and creation year.
Asks for the user’s name and gives a friendly compliment.
Guesses the user’s age using the Chinese Remainder Theorem.
Counts from 0 up to a number the user chooses.
Runs a small quiz to test basic programming knowledge.
Ends with a friendly goodbye message.
đź§© Code Overview
The main functions in the code are:
greet(bot_name, birth_year) – Introduces the chatbot.
remind_name() – Asks for and remembers the user’s name.
guess_age() – Calculates the user’s age using modular math.
count() – Counts up to a number entered by the user.
test() – Asks a multiple-choice question to test the user’s knowledge.
end() – Displays a goodbye message.
⚙️ Requirements
Python 3.6 or later
No external libraries needed — runs on pure Python.