Task
Create a text-based lively chatbot that engages with the user, gathers personal details and provides a fun conversation via several activities in phases.
Instructions
- Bot Introduction:
- The bot first introduces itself with their name, birth-year and creator name.
- Name Reminder:
- Then it asks the user’s name and greets them personally.
- Age guessing:
By asking the user for the remainders of their age when divided by 3, 5 and 7, the bot reveals their age by calculating using Chinese Remainder Theorem:
n = (r1m1 + r2m2 + r3m3) % n1n2n3where,
n- the number to be guessedri- remainder whennis divided by theith numberm1- 70,m2- 21,m3- 15 (miis a modular inverse)n1- 3,n2- 5,n3- 7
- Joke Time:
- The bot offers to tell a joke upon request and delivers a random, lighthearted joke from a built-in collection.
- Riddle Time:
- The bot challenges the user with a multiple-choice question. If the answer is incorrect, it prompts again until the correct choice is selected.
- Farewell:
- Finally, the bot congratulates the user on completing the interaction and says goodbye.
Expected Output
Hello! My name is Chitti.
I was created in 2025.
How can I assist you today?
Please, remind me your name: Vasi // user input
What a lovely name you have, Vasi!
Let me guess your age.
Please, enter remainders of dividing your age by 3, 5 and 7.
Remainder when divided by 3: 1 // user input
Remainder when divided by 5: 2 // user input
Remainder when divided by 7: 1 // user input
Your age is 22, that's a good time to start programming!
Would you like to hear a joke? (yes/no): yes // user input
Why do programmers prefer dark mode? Because light attracts bugs!
Let's test your programming knowledge.
Why do we use methods?
1. To repeat a statement multiple times.
2. To decompose a program into several small subroutines.
3. To determine the execution time of a program.
4. To interrupt the execution of a program.
Please, choose the correct option (1-4): 2 // user input
Correct!
Congratulations, have a nice day!Main Lessons
- Working with data structures to store and manipulate data
- Decomposing a problem into small, reusable functions
Guidelines
Feel free to implement additional features to make your bot more interactive and fun to use.